0

Is this legal in Vue?

<input :name="_charset_" />

Or should I do it like so:

<input name="_charset_" />
1
  • 2
    What are you trying to do? :name actually binds the variable _charset's value to the attribute, while name simply means setting _charset_ as a string as the element's attribute. Commented Jul 9, 2019 at 14:04

2 Answers 2

2

to put in layman's terms.

this is when _charset_ is a variable which you have defined in data() or computed

  <input :name="_charset_" />

this is when _charset_ is a literal string.

<input name="_charset_" />
Sign up to request clarification or add additional context in comments.

Comments

1

this is how you bind data in Vue:

<input :name="_charset_" />

that is the shortcut for

<input v-bind:name="_charset_" />

obviously there must be a property called _charset_

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.