reactive
<script setup lang="ts">
import { reactive } from 'vue'
interface useInfoModel {
name:string;
id:string|number;
actaver?: any;
}
const userInfo = ref<userInfoModel>()
let msg = reactive<number[]>([0, 4, 6])
const btn1 = () => {
msg[0] = 12
console.log('msg', msg, msg[0])
}
</script>
type headType = {
title:string,
icon:string
}
let msg = reactive<headType>({title:"字符串",icon:"字符串icon"})
const btn1 = () => {
msg.title = 5555
}
interface tabBar {
title: string;
id: string | number;
render: boolean;
}
interface Props {
tabbarPage: tabBar[];
}
const props = withDefaults(defineProps<Props>(), {
tabbarPage: ()=>[
{
title: "标题",
id: 1,
render: false,
}
],
});