Skip to content

12 - Optimize performance directive #2172

Open
@cn-2k

Description

@cn-2k
<script setup>
import { ref } from "vue"

const count = ref(0)

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

<template>
  <!-- With the v-once directive, the component was rendered only once, ignoring other updates -->
  <span v-once>Make it not to change: {{ count }}</span>
</template>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions