Vue介绍中的todo-item组件无法显示问题
在Vue官方文档的介绍部分,todo-item组件是无法显示出来,需要在script部分增加一下代码:var vm = new Vue({el: 'todo-item'});完整的代码如下所示:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Learning Vue
·
在Vue官方文档的介绍部分,todo-item组件无法显示出来,需要在script部分增加以下代码:
var vm = new Vue({
el: 'todo-item'
});
完整的代码如下所示:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Learning Vue!</title>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<ol>
<todo-item></todo-item>
</ol>
<script>
Vue.component('todo-item', {
template: '<li>这是个待办事项</li>'
});
var vm = new Vue({
el: 'todo-item'
});
</script>
</body>
</html>
更多推荐
已为社区贡献1条内容
所有评论(0)