Vue: [Feature request]: Please provide the possibility to set aliases for component names

Created on 11 Feb 2017  路  3Comments  路  Source: vuejs/vue

I would like to setup my component structure like this:

-- model 1
---- get.vue
---- save.vie
-- model 2
---- index.vue
---- model 3
------ get.vue
------ save.vue

However, it's not allowed to setup one worded components names like:

<get></get>

Furthermore, it could collide with other components. My idea is to implement something like this:

import Create from './Create.vue'
import Get from './Get.vue'

// ...

components: {
  Create: {
    component: Create,
    alias: 'CreateModel1'
  },
  Get: {
    component: Get,
    alias: 'GetModel1'
  }
}

Most helpful comment

Why? Just write this:

import Create from './Create.vue'
import Get from './Get.vue'

// ...

components: {
  CreateModel1: Create,
  GetModel1: Get
}

All 3 comments

Why? Just write this:

import Create from './Create.vue'
import Get from './Get.vue'

// ...

components: {
  CreateModel1: Create,
  GetModel1: Get
}

As @sirlancelot explained, we don't need a new API for that.

Thanks a lot for the clarification!

Was this page helpful?
0 / 5 - 0 ratings