Why are disabled="false" and disabled passed as attrs eventually rendered as disabled="" ? #12178
Replies: 3 comments 10 replies
-
please notice that colon before disabled. |
Beta Was this translation helpful? Give feedback.
-
Your initial assumption is wrong: <button disabled="false">test</button> is not setting disabled to false. <button disabled>test</button>
<button disabled="false">test</button> The In Vue, if you do this: <button :disabled="false">test</button>` then the So that should be one part of the answer: Vue is just following the HTML specifications. The other part of the question, why Vue picks one representation over another. |
Beta Was this translation helpful? Give feedback.
-
Hey @gzf6 , In HTML, the
Both cases result in Thanks . |
Beta Was this translation helpful? Give feedback.
-
<button disabled>test</button>
<button disabled="false">test</button>
We know that the above two situations express completely opposite meanings, but the actual output results are the same.
<button disabled="">test</button>
Beta Was this translation helpful? Give feedback.
All reactions