基本用法:
<template>
<div>
name: {
{
obj.name}}
<br>
list:
<ul>
<li v-for="(item, index) in obj.list" :key="index"> {
{
item}} </li>
</ul>
<hr>
<button @click="changeName">改变name</button>
<button @click="changeList">改变list</button>
</div>
</template>
<script lang="ts">
import {
defineComponent, reactive, watch} from 'vue';