首页 > 其他 > 详细

vue-cli 组件运用

时间:2019-02-18 10:07:31      阅读:199      评论:0      收藏:0      [点我收藏+]

// 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>

vue-cli 组件运用

原文:https://www.cnblogs.com/JamyWong/p/10393828.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!