2024-10-24 main.js:6 Uncaught TypeError: app is not a function ==》写法错误
vue代码如下:
// main.js import { createApp } from 'vue' import './style.css' import App from './App.vue' const app = createApp(App); app().mount('#app')
报错:
原因:app().mount('#app')写法有误
正确写法应该去掉这个()
import { createApp } from 'vue' import './style.css' import App from './App.vue' const app = createApp(App); app.mount('#app')