Skip to content

Instantly share code, notes, and snippets.

View Tofu-Xx's full-sized avatar
♥️
love you

tofu-xx Tofu-Xx

♥️
love you
View GitHub Profile
@Tofu-Xx
Tofu-Xx / definModel.vue
Last active September 14, 2024 19:17
Optimal implementation of v-model's components communicate
<script setup lang="ts">
let modelValue = defineModel("modelValue", { default: () => (0) })
const ins = () => modelValue.value++
</script>
<template>
<button @click="ins">{{ modelValue }}</button>
</template>