6
帮忙看看 Vue 的问题
source link: https://www.v2ex.com/t/821969
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
环境 vite + vue3 + element plus, 组件中的两端 script 代码,这两处 setup 看日志有一处没有运行,是正常的吗,app 引用的时候提示找不到 "form"
App.vue
<script setup>
import moment from 'moment/min/moment-with-locales'
import { ref, reactive, toRefs, toRef } from 'vue'
console.log("setup from setup");
</script>
<script>
import { reactive, toRefs } from 'vue';
export default {
setup() {
console.log("setup from default");
const state = reactive({
form: {
userName: '',
newPass: '',
}
});
return {
...toRefs(state),
}
},
</script>
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK