[英]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
文件中显示message
并instructor
变量声明器,但它给了我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.