<template>
<div>
<p class="p1">Hello ,This is {{page_name}} now</p>
<test/>
<!-- 3.使用 -->
<hello></hello>
</div>
</template>
<script>
// 1.引入
import HelloWorld from '@/components/HelloWorld'
export default {
name: 'Googs',
data () {
return {
page_name: 'Googs Page address'
}
},
// 2.注册
components:{
'test':{
template:'<p>test</p>'
},
'Hello':HelloWorld
}
}
</script>
<style scoped>
.p1{color:red}
</style>

本文介绍了一个名为Googs的应用中Vue.js组件的定义与使用方式,包括基础组件的自定义和样式设置。通过具体示例展示了如何在Vue项目中创建和注册自定义组件,并为这些组件应用特定的样式。
585

被折叠的 条评论
为什么被折叠?



