当前位置:
首页
文章
前端
详情

vue 2.0 第一个坑,组件不显示的问题

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>app-component</title>
</head>
<body>
<ol>
    <todo-item></todo-item>
</ol>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
    //组件
    Vue.component('todo-item', {
        template: '<li>这是个待办项</li>'
    });

    new Vue({
        el: 'todo-item'
    });
</script>
</body>
</html>

new Vue({
        el: 'todo-item'
});

这里必须要有的,官方文档也没有看到,没有这一段,不显示组件

免责申明:本站发布的内容(图片、视频和文字)以转载和分享为主,文章观点不代表本站立场,如涉及侵权请联系站长邮箱:xbc-online@qq.com进行反馈,一经查实,将立刻删除涉嫌侵权内容。