Last active
January 9, 2023 20:34
-
-
Save webislife/1bd98768ca69e3bd235e06ce99402889 to your computer and use it in GitHub Desktop.
v-once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
import { ref } from 'vue' | |
let message = ref("Hello World") | |
let updateMessage = () => { | |
message.value = 'Goodbye World' | |
} | |
</script> | |
<template> | |
<h1 v-once>{{message}}</h1> | |
<input :value="message" /> | |
<button @click="updateMessage"> | |
Update Message | |
</button> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment