鍍金池/ 問答/ HTML問答
空白格 回答

因為箭頭函數(shù)本身沒有this,它是根據(jù)當前的作用域鏈向上查找this的指向,你的題目當前this的指向是Window對象,所以才會出現(xiàn)最后的編譯結果

幼梔 回答

好像官方文檔也沒有說賦值初始值的,我一般這樣用:

<el-select v-model="postForm.articleclassify" filterable remote placeholder="搜索分類" :remote-method="remoteArticleClassifyList">
  <el-option v-for="(item,index) in ArticleClassifyList" :key="index" :label="item.name" :value="item.value">
  </el-option>
</el-select>

加載的時候,初始值是postForm.articleclassify 選項的值通過后面的迭代出來。

筱饞貓 回答

我前段時間正好寫過electron的下載,正常的electron實現(xiàn)下載是怎樣的呢?
先要說下electron的ipc通信,ipcMain,ipcRenderer
electron內(nèi)主進程和渲染進程是通過ipc通信的
主進程(main.js)定義 監(jiān)控 函數(shù)

ipcMain.on('download', (evt, args) => {
    let url = JSON.parse(args);
    downloadUrl = url.downloadUrl;
    saveUrl = url.saveUrl;
    mainWindow.webContents.downloadURL(downloadUrl);
});

渲染進程(頁面)調(diào)用ipcRenderer來觸發(fā)

ipcRenderer.send('download', JSON.stringify({
    downloadUrl: `${ipURL()}${url}`,
    saveUrl: result[0]
}));

這樣就可以觸發(fā)主進程的下載動作,至于下載動作是怎樣的我就不寫了,官方上都有,
如果向阻止electron只要把main.js里的

ipcMain.on('download', (evt, args) => {
    let url = JSON.parse(args);
    downloadUrl = url.downloadUrl;
    saveUrl = url.saveUrl;
    //mainWindow.webContents.downloadURL(downloadUrl);
});

注釋掉就行了

當然每個人的寫法可能不一樣,但是都是通過ipc從渲染進程發(fā)送給主進程的,找到主進程里開始下載的動作,關掉就可以了

忠妾 回答

weex最終給你的是個view啊 想怎么放都行

話寡 回答

elementA+elementB 選擇所有緊隨elementAelementB。

氕氘氚 回答

在你的css的文件頭部加上encoding聲明:

@charset "UTF-8";

否則瀏覽器按操作系統(tǒng)編碼去解析css文件,在windows下(非utf8編碼)就亂碼,也就找不到文件了。

毀憶 回答

大...大哥,這應該不是閉包吧

葬憶 回答

根據(jù)選擇的類型,要么直接把不符合要求的直接過濾掉,或者在點擊的時候進行判斷

笑忘初 回答

如果想在你標示的外部代碼里寫,那是不可能的。
以前有人也有和你一樣的問題,然后就有了commonjs、requirejs等,現(xiàn)在模塊加載已經(jīng)成了ES6的標準。
所以如果你有強迫癥,那就不能嫌麻煩,把模塊加載相關的姿勢擼了吧。

逗婦乳 回答

img.onload 哪個教程或者文檔告訴你 它是帶參的

自說自話的,加了三個參數(shù)進去,

img.onload 是被誰調(diào)用的,先要搞清楚

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <input type="file" onchange='fileChoosed(event)'>
  <img id='a'>
  <script>
    function fileChoosed(event) {
      console.log('aa');
      let file = event.target.files[0],
        fileName = file.name,
        img = document.getElementById('a'),
        fr = new FileReader(),
        ts = this;
      fr.addEventListener("load", () => {
        let blob = 'a';
        console.log(fileName, img, blob); //這里能獲取到三個變量
        img.onload = () => { //不建議在瀏覽器里直接用箭頭函數(shù),支持不好
          debugger;
          console.log(fileName, img, blob); 經(jīng)過測試是可以打印這三個變量的
        };
        img.src = fr.result;
      });
      fr.readAsDataURL(file);
    }
  </script>
</body>

</html>
不討喜 回答

https://packagist.org/package...
圖片描述

雖然不知道你為什么要下載那么古老的 2.0.5 的版本,但是 composer 官網(wǎng)上的 yiisoft/yii2-app-advanced 包并沒 2.0.5 版本。

現(xiàn)在 yiisoft/yii2-app-advanced 的最新版本是 2.0.14,可以使用如下命令進行下載:

composer create-project yiisoft/yii2-app-advanced advanced 2.0.14

實際上,到目前為止,yii2框架核心的版本已經(jīng)是 2.0.15.1,安裝時composer 會自動將其升級為最新版本。

[/tmp] ]$composer create-project yiisoft/yii2-app-advanced advanced 2.0.14
Installing yiisoft/yii2-app-advanced (2.0.14)
  - Installing yiisoft/yii2-app-advanced (2.0.14): Loading from cache
Created project in advanced
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 59 installs, 0 updates, 0 removals
  - Installing yiisoft/yii2-composer (2.0.6): Loading from cache
  - Installing swiftmailer/swiftmailer (v5.4.9): Loading from cache
  - Installing bower-asset/jquery (3.2.1): Loading from cache
  - Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
  - Installing bower-asset/punycode (v1.3.2): Loading from cache
  - Installing cebe/markdown (1.1.2): Loading from cache
  - Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
  - Installing bower-asset/inputmask (3.3.11): Loading from cache
  - Installing yiisoft/yii2 (2.0.15.1): Loading from cache
  - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
  - Installing bower-asset/bootstrap (v3.3.7): Loading from cache
  - Installing yiisoft/yii2-bootstrap (2.0.8): Loading from cache
  - Installing yiisoft/yii2-debug (2.0.13): Loading from cache
  - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
  - Installing phpspec/php-diff (v1.1.0): Loading from cache
  - Installing yiisoft/yii2-gii (2.0.6): Loading from cache
  - Installing fzaninotto/faker (v1.7.1): Loading from cache
  - Installing yiisoft/yii2-faker (2.0.4): Loading from cache
  - Installing doctrine/instantiator (1.0.5): Loading from cache
  - Installing phpunit/php-text-template (1.2.1): Loading from cache
  - Installing sebastian/recursion-context (2.0.0): Loading from cache
  - Installing sebastian/exporter (2.0.0): Loading from cache
  - Installing phpunit/phpunit-mock-objects (3.4.4): Loading from cache
  - Installing codeception/stub (1.0.2): Loading from cache
  - Installing sebastian/diff (1.4.3): Loading from cache
  - Installing sebastian/version (2.0.1): Loading from cache
  - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
  - Installing phpunit/php-file-iterator (1.4.5): Loading from cache
  - Installing sebastian/resource-operations (1.0.0): Loading from cache
  - Installing sebastian/comparator (1.2.4): Loading from cache
  - Installing webmozart/assert (1.3.0): Loading from cache
  - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
  - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (3.3.2): Loading from cache
  - Installing phpspec/prophecy (1.7.5): Loading from cache
  - Installing myclabs/deep-copy (1.7.0): Loading from cache
  - Installing phpunit/php-token-stream (1.4.12): Loading from cache
  - Installing sebastian/environment (2.0.0): Loading from cache
  - Installing phpunit/php-code-coverage (4.0.8): Loading from cache
  - Installing phpunit/php-timer (1.0.9): Loading from cache
  - Installing sebastian/global-state (1.1.1): Loading from cache
  - Installing sebastian/object-enumerator (2.0.1): Loading from cache
  - Installing symfony/yaml (v3.4.8): Downloading (100%)
  - Installing phpunit/phpunit (5.7.27): Loading from cache
  - Installing codeception/phpunit-wrapper (6.0.9): Downloading (100%)
  - Installing behat/gherkin (v4.5.1): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
  - Installing symfony/dom-crawler (v3.4.8): Downloading (100%)
  - Installing symfony/css-selector (v3.4.8): Downloading (100%)
  - Installing symfony/browser-kit (v3.4.8): Downloading (100%)
  - Installing symfony/event-dispatcher (v3.4.8): Downloading (100%)
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v3.4.8): Downloading (100%)
  - Installing symfony/console (v3.4.8): Downloading (100%)
  - Installing symfony/finder (v3.4.8): Downloading (100%)
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.4.2): Loading from cache
  - Installing codeception/base (2.4.1): Downloading (100%)
  - Installing codeception/verify (0.3.3): Loading from cache
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.1)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
symfony/browser-kit suggests installing symfony/process ()
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/event-dispatcher suggests installing symfony/http-kernel ()
symfony/console suggests installing symfony/lock ()
symfony/console suggests installing symfony/process ()
codeception/base suggests installing aws/aws-sdk-php (For using AWS Auth in REST module and Queue module)
codeception/base suggests installing codeception/phpbuiltinserver (Start and stop PHP built-in web server for your tests)
codeception/base suggests installing codeception/specify (BDD-style code blocks)
codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
codeception/base suggests installing league/factory-muffin (For DataFactory module)
codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
codeception/base suggests installing stecman/symfony-console-completion (For BASH autocompletion)
codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
Writing lock file
Generating autoload files
不討喜 回答

你需要用一個數(shù)組,或者是綁定到item上面的某個屬性

影魅 回答

computed,數(shù)據(jù)分一下吧

維她命 回答
  1. 不知道你平時寫業(yè)務會不會用到框架,如果用了Vue、React、Angular,你基本都是在寫面向對象的東西。
  2. 如果是前后端分離的項目,前后端的通信肯定是需要建立在同一的數(shù)據(jù)模型之上的,那么可以在前端嘗試用service的方式給前端組件提供數(shù)據(jù),通常寫service會用到面向對象的編程
舊時光 回答

safari瀏覽器可能禁止彈出框