vuejs-challenges icon indicating copy to clipboard operation
vuejs-challenges copied to clipboard

12 - 优化性能的指令

Open mu-muw opened this issue 1 year ago • 2 comments

// 你的答案
<script setup>
import { ref } from "vue"

const count = ref(0)

setInterval(() => {
  count.value++
}, 1000)
</script>

<template>
  <!-- v-once指令会渲染元素一次,然后将其从DOM中删除 -->
  <span v-once>使它从不更新: {{ count }}</span>
</template>


mu-muw avatar Dec 08 '23 01:12 mu-muw

finished

shenrui1 avatar Jan 09 '24 11:01 shenrui1

v-memo=[ ]也行

undefined-zzk avatar Jan 28 '24 07:01 undefined-zzk