Jsfiddle vue v2.2.1: https://jsfiddle.net/dobuznsc/1/
Jsfiddle vue v1.0.12: https://jsfiddle.net/dobuznsc/2/
As you can see, there're 3 textareas and inputs in 3 different scopes:
My question is, why are textareas in root and component scope handled differently, is this a bug?
Because the component template is compiled by vue while the other one is interpreted by the browser before vue can compile it.
Inside of textareas only text can be entered, therefore when Vue tries to put HTML inside of it, the browser probably ignores that. What you actually want is to write an escaped version of it: <textarea><p>Component textarea</p></textarea>
Maybe we could add a development warning, but basically, you cannot write unescaped HTML inside of a textarea. More specifically, you can only write text. The browser escapes it for convenience I guess.
Great, makes sense, it works with escaped HTML. I didn't even think about escaping since it worked in v1.
Technically we can make the HTML parser treat the entire content of <textarea> as a string. This could use a PR if anyone is up for it.
I can try that, I'm not sure I will manage to do that but I will try
Most helpful comment
Technically we can make the HTML parser treat the entire content of
<textarea>as a string. This could use a PR if anyone is up for it.