本文实例为大家分享了vue组件的书写形式,供大家参考,具体内容如下
第一种使用script标签
<-- 注意:使用
第二种使用template标签
This is a component!
第三种 单文件组件
这种方法常用在vue单页应用中。详情看官网:https://cn.vuejs.org/v2/guide/single-file-components.html
创建.vue后缀的文件,组件Hello.vue,放到components文件夹中
{{ msg }}
app.vue
#app { font-family: 'Avenir', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px; }
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



