Vue中定义私有组件

请陛下批阅

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定义私有组件</title>
    <script src="../../vue/vue-v2.6.11.js"></script>

</head>
<body>
<div id="app">
    <login></login>
</div>
<template id="tmpl">
    <h2>这是定义的私有组件</h2>
</template>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {

        },
        components: {
            login: {
                template: '#tmpl'
            }
        }
    });
</script>
</html>
发布了62 篇原创文章 · 获赞 0 · 访问量 1247

猜你喜欢

转载自blog.csdn.net/weixin_45616246/article/details/105478247