当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Vue.js components用法及代码示例

注册组件以供组件实例使用的对象。

类型

interface ComponentOptions {
  components?: { [key: string]: Component }
}

示例

import Foo from './Foo.vue'
import Bar from './Bar.vue'

export default {
  components: {
    // shorthand
    Foo,
    // register under a different name
    RenamedBar: Bar
  }
}

相关用法


注:本文由纯净天空筛选整理自vuejs.org大神的英文原创作品 components。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。