1.setup() 页面创建之前执行的函数。所以整个面用setup()函数来初始化参数
import {reactive,toRefs} from "vue"
export default {
name: "Home",
setup() {
const fromData = reactive({
userName:'admin',
password:'123456'
})
const data = toRefs(fromData);
return {
...data
}
}
};
网友评论