vue3 computed typeScript
Posted 安果移不动
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue3 computed typeScript相关的知识,希望对你有一定的参考价值。
<template>
<div>
<input type="text" v-model="firstName">
<input type="text" v-model="lastName">
<p> firstName --- lastName </p>
<p>name: name </p>
</div>
<div>
<button @click="change">修改</button>
</div>
</template>
<script setup lang="ts">
import computed, ref from "vue";
let firstName = ref("");
let lastName = ref("");
const name = computed(
get()
return firstName.value + " " + lastName.value
,
set(value)
firstName.value + lastName.value
)
</script>
以上是关于vue3 computed typeScript的主要内容,如果未能解决你的问题,请参考以下文章