vue-cli 组件运用
// components
----- helloworld.vue
<script>
export default {
name: 'Hellowworld',
props: {
//接收标签为msg的内容,文件格式为:string.
msg: String
}
}
</script>
// Views
----- Home.vue
<template>
<div class="home">
//将msg的string内容传给Helloworld组件
<Helloworld msg="welcome to your vue.js App">
</div>
</template>
<script>
//引进组件
import Helloworld from '@/compoents/Helloworld.vue'
export default {
name: 'home',
components: {
//组件内容
Helloworld
}
}
</script>