出口默认情况下'name'的目的/用途是什么?{}

hid*_*dar 2 javascript node.js ecmascript-6 vue.js

我正在学习vuejs,我无法理解为什么需要这个名字.

<template>
</template>
<script>
  export default {
    name: 'NotFound'
  }
</script>

<style>
</style>
Run Code Online (Sandbox Code Playgroud)

例如,您可以在此文件中看到上述代码的来源https://github.com/misterGF/CoPilot/blob/master/src/components/404.vue 这个名称什么都不做,但为什么我们需要它.

Boh*_*ang 5

组件可以在自己的模板中递归调用自己.但是,他们只能使用name选项

https://vuejs.org/v2/guide/components.html#Recursive-Components