Vue组件之间的引用

以下介绍的引用方式只是多个引用方式中的一种

A引用B
<!-- A -->
<template>
  <test></test>
</template>

<script>
  import test from './Eu'

  export default {
    name: 'index',
    components: {
      test
    }
  }
</script>

<!-- B -->
<template>
  <h2>
    引用内容
  </h2>
</template>
<script>
  export default ({
 //此处name是否设置作用不大
    name: 'eu'
  })
</script>

发表回复

您的电子邮箱地址不会被公开。

15 − 4 =