小弟在進行專案時只用element ui 的popover遇到了一個問題列表中的每一項都要有一個相應的popover?但發現如果列表有100項 這個popover生成的節點就有100個擔心這會對效能造成問題<ul class="rooms m-b" v-if="showing.length"> <li v-for="(item, index) in showing" :key="index"> <el-popover placement="right" trigger="click"> <div> <div class="action pointer" @click="enterChat(item)">與 {{item.username}} 談話</div> <div class="action pointer" @click="handleChatClick(item)">查看 {{item.username}}</div> </div> <div class="meta" slot="reference"> <span class="title"> <span>{{ item.username }}</span> </span> </div> </el-popover> </li> </ul>不知有沒有共用一個節點內容的方法(只生成一個節點, 或是需要時才渲染當個popover的方法)我的代碼
element ui 的popover 搭配v-for 遍歷的效能問題
眼眸繁星
2019-03-14 14:15:13