在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答

從我的水平來看,這么寫是可以的,哈哈,不過還是有可以修改的 select_index.push(this.tableAllData[index])中的this.tableAllData[index] 可以直接是val,你不是已經(jīng)循環(huán)遍歷出來了嗎

奧特蛋 回答

圖片描述

之前這個地方是沒有解綁按鈕的,現(xiàn)在又有了(對比我提問時的截圖)。真的坑....
如果不知道怎么解綁開放平臺綁定的可以試試這個方法。

生性 回答
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
  #img {
    width: 300px;
    height: 300px;
    margin: 100px auto;
    background: red;
  }
#img2 {
    width: 188px;
    height: 188px;
    backface-visibility: hidden;
    transition: all 1s ease;
    background: orange;
}
  #img:hover #img2 {
    transform: scale(2) translate(100px, 100px);
  }
  </style>
</head>

<body>
  <div id="img">
    <div id="img2"></div>
  </div>
</body>

</html>

copy 到 文件執(zhí)行下就可以了

哎呦喂 回答

this.$nextTick(function(){}

疚幼 回答

props.children

<div>
    {this.props.children}
</div>

<AbbottTest>
    <Foundation />
</AbbottTest>

this.props.chilren就像當(dāng)與 那個內(nèi)部的 <Foundation />了

反正React16之前是可以這樣寫, 好像16之后你可以用Portal。 Portal我也沒用過。

不知道你的defaultProps還有沒有效,我知道可以這樣寫

骨殘心 回答

php.ini沒什么改的。
主要是php-fpm的配置

clipboard.png

pm = dynamic
pm.max_children = 20
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

內(nèi)存足夠大的情況下,計算一下每個子進程會耗多少內(nèi)存,,我這個是設(shè)置比較低。

臭榴蓮 回答

第一個問題:怎樣銷毀緩存,官網(wǎng)也說了,用keep-alive的時候,配合activated使用,需要銷毀緩存的時候,把數(shù)據(jù)清空(數(shù)據(jù)驅(qū)動沒毛病吧).
第二個問題:詳情頁里面的相關(guān)推薦點擊會再次進入詳情頁,只是id變了,頁面沒變,此時beforeRouteUpdate這個鉤子會觸發(fā)。個人用這個鉤子是因為:點相關(guān)推薦切換的時候會閃動上次sku的內(nèi)容,而且很久。

刮刮樂 回答

這個問題你需要知道什么是異步執(zhí)行
這個要講清楚不是三言兩語的事,詳細的建議你自己查下,我這里只簡單說下為什么 log 出來總是 a

請看下面的代碼,我在注釋里用數(shù)字標明這段代碼實際執(zhí)行的順序,可能與你原本所預(yù)期的有所不同:

const Login_Scope = this;                    // 1
let Post_List = 'a';                         // 2
axios.get('/api/postList')                   // 3
  .then(function (response) {
    console.log(response);                   // 6
    Login_Scope.Post_List = response.data;   // 7
  })
  .catch(function (error) {
    // vm.answer = 'Error! Could not reach the API. ' + error
  });
  console.log(Post_List);                    // 4
  return {                                   // 5
    postList: Post_List,
  }
}

具體為什么會這樣,還是先了解下異步請求Promise

補充

那么你想實現(xiàn)的這個效果應(yīng)該怎么寫呢:

export default {
  data () {
    return {
      postList: 'a',
    }
  },
  // 或者 created
  mounted () {
    const Login_Scope = this;
    axios.get('/api/postList') 
      .then(function (response) {
        Login_Scope.postList = response.data;
        console.log(Login_Scope.postList); 
      })
      .catch(function (error) {
        // vm.answer = 'Error! Could not reach the API. ' + error
      });
  }
}

希望對你有幫助

司令 回答

樓上的回答有一點缺陷。

白天我看到這個問題也是這么想的,可是setStaterender并沒有自帶的shallow compare,猜想不成立。剛才自己試了一下,即使是空的setState也可以觸發(fā)當(dāng)前組件re-render。

至于題目中出現(xiàn)的情況,我猜測有fetch的容器組件跟列表項展示組件是分開的,同時展示組件使用了PureComponent或者在ShouldComponentUpdate中做了shallow compare,或者是其他的節(jié)流方案。總之對于不改變地址的imageList數(shù)組而言,是無法觸發(fā)展示組件的re-render的。

樓上回答的缺陷在于,如果不使用節(jié)流方案,那么React本身不會進行任何shallow compare,所有的變動都是基于最終得出的Vitural DOM diff來進行的,用來對比的不是imageList本身,而是每一個由imageList map出來的item。即若能觸發(fā)展示組件的re-render,即使不改變數(shù)組的引用,依然可以正確顯示變動

愿如初 回答

只能通過JQ去切換CSS了。。昨天自己已經(jīng)解決。

拼未來 回答

使用

Promise.all([axios1, axios2]).then(() => {
  // 隱藏loading
})
念初 回答

該插件的github上是這么使用的:

this.$toast('toast', 2500, { color: 'red', backgroundColor: 'rgba(125, 43, 86, .4)' })

如果還不知道怎么使用,可以用我寫的一個插件: vue-toast

賤人曾 回答

模板

<div>
  <label><input type="checkbox" [(ngModel)]="checked" (change)="selectAll()">全選</label>
  <div style="padding-left:1em" *ngFor="let item of datas">
    <label><input type="checkbox" [(ngModel)]="item.checked" (change)="selectItemAll(item)">全選</label>
    <div style="padding-left:1em" *ngFor="let item1 of item.items">
      <label><input type="checkbox" [(ngModel)]="item1.checked" (change)="selectItem(item1,item)">選擇</label>
      名稱:{{item1.name}} 價格:{{item1.price}}
    </div>
  </div>
  總價:{{getTotal()}}
</div>

ts

checked = false
  datas = [{
    checked: false,
    items: [{
      checked: false,
      name: '商品11',
      price: 2
    }, {
      checked: false,
      name: '商品12',
      price: 3
    }]
  }, {
    checked: false,
    items: [{
      checked: false,
      name: '商品21',
      price: 2
    }, {
      checked: false,
      name: '商品22',
      price: 3
    }]
  }]
  getTotal() {
    return this.datas.reduce((state, item) => {
      return item.items.reduce((state, item1) => {
        return state + (item1.checked ? item1.price : 0)
      }, state)
    }, 0)
  }
  selectAll() {
    this.datas.forEach(item => {
      item.checked = this.checked
      item.items.forEach(item1 => {
        item1.checked = this.checked
      })
    })
  }
  selectItemAll(item) {
    item.items.forEach(item1 => {
      item1.checked = item.checked
    })
    if (!item.checked) {
      this.checked = false
    } else {
      this.checked = this.datas.reduce((prev, item) => prev && item.checked, true)
    }
  }
  selectItem(item, parent) {
    if (!item.checked) {
      parent.checked = this.checked = false
    } else {
      parent.checked = parent.items.reduce((prev, item) => prev && item.checked, true)
      if (parent.checked) {
        this.checked = this.datas.reduce((prev, item) => prev && item.checked, true)
      } else {
        this.checked = false
      }
    }
  }
熟稔 回答

IP白名單設(shè)置頁,不要打鉤,IP隨便填一個,確定
圖片描述

尐飯團 回答

打開頁面等待加載完畢后 打開開發(fā)者工具
轉(zhuǎn)到 Network 面板勾選 Offline(離線) 復(fù)選框,不要刷新頁面

clipboard.png

再轉(zhuǎn)到 Source 面板找到這個文件并格式化代碼

clipboard.png

格式化代碼之后 CTRL + G 跳轉(zhuǎn)到 2152 行打一個斷點

clipboard.png

然后點擊頁面上的篩選標簽 觸發(fā)加載失敗提示框 查看樣式

clipboard.png

不討囍 回答

你子路由沒必要寫全路徑呀,子路由若是以父路由為前綴,直接省略哪部分就好了