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>

posted @ 2019-02-18 09:27  Jamy  阅读(344)  评论(0编辑  收藏  举报