// main.jsimport{ createApp }from'vue'importAppfrom'./App.vue'constapp =createApp(App) <!--App.vue组件 --><template>点我触发init</template>import{ ref, onMounted }from'vue';exportdefault{setup() {// 如果题主是需要初始化函数,就在组件挂载后执行onMounted(() =>{init() });// 如果...
// main.js import { createApp } from 'vue' import App from './App.vue' const app = createApp(App) <!-- App.vue组件--> <template> 点我触发init </template> import { ref, onMounted } from 'vue'; export default { setup() { // 如果题主是需要初始化函数,就在组件挂载后执行...