v-once
Last updated
What is v-once?
The v-once directive makes an HTML element render only once, skipping every future update.
Example
<script setup>
import { ref } from 'vue';
const input = ref("Some Text");
</script>
<template>
<input v-model="input">
<p v-once>{{ input }}</p>
</template>
In this example the p element will not change its text even if the input variable is changed through the input element.
Free resources to learn v-once
- Official docsv-once Documentation
More in stage 7: Forms Handling
v-once: common questions
Can I learn v-once in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain v-once in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this v-once tutorial for beginners?
It is lesson 31 of 84 in the free Vue roadmap, in stage 7, Forms Handling. If you are new to Vue, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.