Skip to content

Conversation

@chenjiahan
Copy link

import Vue from 'vue' import Component from 'vue-class-component' @Component({ name: 'app' }) export default class App extends Vue { public name: string; }
@ktsn
Copy link
Member

ktsn commented Feb 6, 2017

Why don't you use vm.$options.name? What is the use case of this?

@chenjiahan
Copy link
Author

This is used for registering a global component.

import App from './app'; Vue.component(App.name, app);
@ktsn
Copy link
Member

ktsn commented Feb 6, 2017

I think this feature should be in core extend method because vue-class-component intends to just wrap Vue.extend api and provide class like syntax.
Would you mind to send PR to core repo?

@HerringtonDarkholme
Copy link
Member

Isn't App.options.name enough? I wonder.

@chenjiahan
Copy link
Author

App.options.name is a little weird, I'm trying to find a more elegant solution.

@ktsn
Copy link
Member

ktsn commented Feb 7, 2017

In my understanding, App.options is officially undocumented api but it can fill the use case.
If you want safer solution, you should request api to core as I mentioned.

@ktsn ktsn closed this Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants