@@ -368,6 +368,16 @@ CompilerProto.checkPriorityDir = function (dirname, node, root) {
368368 */
369369CompilerProto . compileElement = function ( node , root ) {
370370
371+ // textarea is pretty annoying
372+ // because its value creates childNodes which
373+ // we don't want to compile.
374+ if ( node . tagName === 'TEXTAREA' && node . value ) {
375+ node . value = this . eval ( node . value )
376+ }
377+
378+ // only compile if this element has attributes
379+ // or its tagName contains a hyphen (which means it could
380+ // potentially be a custom element)
371381 if ( node . hasAttributes ( ) || node . tagName . indexOf ( '-' ) > - 1 ) {
372382
373383 // skip anything with v-pre
@@ -442,7 +452,7 @@ CompilerProto.compileElement = function (node, root) {
442452 }
443453
444454 // recursively compile childNodes
445- if ( node . hasChildNodes ( ) && node . tagName !== 'TEXTAREA' ) {
455+ if ( node . hasChildNodes ( ) ) {
446456 slice . call ( node . childNodes ) . forEach ( this . compile , this )
447457 }
448458}
@@ -465,7 +475,7 @@ CompilerProto.compileTextNode = function (node) {
465475 if ( token . key . charAt ( 0 ) === '>' ) { // a partial
466476 el = document . createComment ( 'ref' )
467477 directive = Directive . parse ( 'partial' , token . key . slice ( 1 ) , this , el )
468- } else { // a real binding
478+ } else {
469479 if ( ! token . html ) { // text binding
470480 el = document . createTextNode ( '' )
471481 directive = Directive . parse ( 'text' , token . key , this , el )
0 commit comments