简体   繁体   English

未捕获的 TypeError:Vue 不是构造函数

[英]Uncaught TypeError: Vue is not a constructor

i am newbie in vuejs 3 , i am starting training, i want to display the message and instructor the variables declarer in script.js file but it gives me Vue is not a constructor error.我是vuejs 3的新手,我正在开始培训,我想在script.js文件中显示messageinstructor变量声明器,但它给了我Vue不是constructor错误。

 new Vue.createApp()({ el: '#app', data: { message: "formation vuejs with najib marzouk", instructor: "MARZOUK NAJIB" } })
 <,DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width. initial-scale=1.0"> <title>formation vuejs</title> <script src="vue.js"></script> </head> <body> <h1>hello the devs</h1> <div id="app"> <h4>{{ message }}</h4> <p>{{ instructor }}</p> </div> <script src="script.js"></script> </body> </html>

You can instantiate and mount the root component like this您可以像这样实例化和挂载根组件

const app = Vue.createApp({
  data() {
    return {
       ...
    }
  }
})
app.mount('#app')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM