我使用v-for渲染一個div,然后改變渲染的數組,那么div的內容會重繪,但是頁面很卡//content是組件數組,用作v-forthis.content = ['com1','com2','com3','com4']
<div id="test">
<div :is="item" v-for="(item,index) in content"></div>
</div>如果我改變content數組的內容,比如改成:this.content = ['new1','new2','new3','new4','new5','new6','new7']那么這時候id為test的div里面的內容會重繪,由于我的組件內容很多,重繪的時候,頁面會卡頓,請問有什么好的解決方案嗎?
使用vue2.0的v-for渲染一個div,v-for數組變化時,重繪性能很低,頁面很卡
侃侃爾雅
2018-08-30 19:13:42