Javascript 如何解决未检测到vuejs的问题
quand j'execute index.html j obtient{{name}toujours vuejs est non detectéJavascript 如何解决未检测到vuejs的问题,javascript,html,vue.js,Javascript,Html,Vue.js,quand j'execute index.html j obtient{{name}toujours vuejs est non detecté <html> <head> <meta charset="UTF-8" /> <title>learn vuejs</title> <link rel="shortcut icon" href="#
<html>
<head>
<meta charset="UTF-8" />
<title>learn vuejs</title>
<link rel="shortcut icon" href="#" />
</head>
<body>
<div id="j">{{ name }}</div>
<script src="js/vue.min.js"></script>
<script >
new Vue({
ele: "#j",
data: {
name: "welcome to vue",
},
});</script>
</body>
学习vuejs
{{name}}
新Vue({
ele:“j”,
数据:{
名称:“欢迎来到vue”,
},
});
刚刚使用了以下代码:
newvue({
el:“j”,
数据:{
名称:“欢迎来到vue”,
},
})
不要使用
ele
,只需使用el
即可设置事件侦听器:
document.addEventListener('DOMContentLoaded', function () {
new Vue({
el: '#j',
// define data - initial display text
data: {
name: "welcome to vue",
}
})
})
我建议你先来。另外,请在StackOverflow上坚持使用英语。我很高兴听到这个消息