Drozerah
Drozerah

Reputation: 236

VueJs component name reserved words?

When creating a component with the name 'Title' the terminal return an error

<Title msg="my title"/>

Is VueJs reserves words so it could explain this ?

Upvotes: 2

Views: 5126

Answers (3)

Muhammed Anees
Muhammed Anees

Reputation: 1850

You are getting this error because you cannot name a component with an existing html tag. Title is a reserved keyword in html. Rename you component to something else.

Upvotes: 4

Dima Melnik
Dima Melnik

Reputation: 884

You can't redefine standard HTML tags as your custom component. https://www.w3schools.com/TagS/tag_title.asp

Upvotes: 1

Hamilton Gabriel
Hamilton Gabriel

Reputation: 365

In fact every language has its words reserved, if I were you I would be afraid to put certain words, because they can be conflicting, it follows a list of words that are reserved within the web itself, and it does not make sense to want to create something with a reserved word, a reserved word, would be something that the language itself uses in its composition, and thus could be a conflict if it were used. https://developer.mozilla.org/en-US/docs/Web/HTML/Element

Upvotes: 0

Related Questions