Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option 'name' on component creation gives warning and doesn´t work #3472

Closed
indus opened this issue Aug 18, 2016 · 3 comments
Closed

option 'name' on component creation gives warning and doesn´t work #3472

indus opened this issue Aug 18, 2016 · 3 comments
Labels

Comments

@indus
Copy link

indus commented Aug 18, 2016

Vue.js version

2.0.0-rc.2

Reproduction Link

http://jsfiddle.net/af3cq646/1/

var CUSTOM = Vue.component('custom',{name:'custom'});
console.log(new CUSTOM());

Steps to reproduce

run fiddle and open console

What is Expected?

no warning and component showing up with the name 'custom'

What is actually happening?

warning "_[Vue warn]: options "name" can only be used as a component definition option, not during instance creation_" and component is named "VueComponent"

@LinusBorg LinusBorg added the bug label Aug 18, 2016
@LinusBorg
Copy link
Member

Can confirm this, came across this yesterday as well.

@indus
Copy link
Author

indus commented Aug 22, 2016

Name in console is still "VueComponent" in version 2.0.0-rc.3 !?

@LinusBorg LinusBorg reopened this Aug 22, 2016
@yyx990803
Copy link
Member

2.0 doesn't use new Function to change constructor name anymore (this is to make the whole runtime build CSP-compliant) - the name option only affects debug messages and vue-devtools inspection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants