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

相关文章:

  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-04-29
  • 2021-09-27
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-09-20
  • 2022-12-23
  • 2021-07-27
  • 2021-07-31
  • 2022-12-23
相关资源
相似解决方案