Skip to content

Instantly share code, notes, and snippets.

@webislife
Last active January 9, 2023 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webislife/1bd98768ca69e3bd235e06ce99402889 to your computer and use it in GitHub Desktop.
Save webislife/1bd98768ca69e3bd235e06ce99402889 to your computer and use it in GitHub Desktop.
v-once
<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