Skip to content

Instantly share code, notes, and snippets.

@webislife
Created January 9, 2023 20:36
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/deb0e805b0edea2334b07a75196cf9bb to your computer and use it in GitHub Desktop.
Save webislife/deb0e805b0edea2334b07a75196cf9bb to your computer and use it in GitHub Desktop.
v-memo.vue
<script setup>
import { ref } from'vue'
let message = ref("Hello World")
let question =ref("How are you?")
let updateMessage= () => { message.value ='Goodbye World' }
let updateQuestion= () => { question.value ='What is your name?' }
</script>
<template>
<h1 v-memo="[ message ]">{{message}} - {{question}}</h1>
<button @click="updateMessage"> Обновить сообщение </button>
<button @click="updateQuestion"> Обновить вопрос </button>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment