Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 2.36 KB

File metadata and controls

25 lines (16 loc) · 2.36 KB

Optimize performance directive medium #Directives #Built-ins

By webfansplz @webfansplz

Take the Challenge    简体中文

Vue.js provides a directive that renders the element and the component only once, and skips future updates.

Do you know what the directive is?. Lets try it 👇:

<script setup>
import { ref } from "vue"

const count = ref(0)

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

<template>
  <span>Make it not to change: {{ count }}</span>
</template>

Back Share your Solutions Check out Solutions