vue学习笔记 四、定义组件(组件基本结构)
|
系列导航 | ||
|---|---|---|
组件:组件是维护单一功能,可复用的单个个体。

如上Home.vue内容如下:
如下就是一个组建的基本结构
<template>
//编写html内容
</template>
<script>
//编写js内容
import {defineComponent} from 'vue'
export default defineComponent({
//组件名称
name:'Home',
//接收父组件的数据
props:{
},
setup(props,ctx){
return{
}
}
})
</script>
<style scoped lang="scss">
//编写样式 scoped 只在当前组件生效
</style>
浙公网安备 33010602011771号