Skip to content

Commit 55d8dbe

Browse files
author
Evan You
committed
fix #176 again...
1 parent 5872bf3 commit 55d8dbe

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/compiler.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,16 @@ CompilerProto.checkPriorityDir = function (dirname, node, root) {
368368
*/
369369
CompilerProto.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)

src/directives/model.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ module.exports = {
2727
self.lock = false
2828
self.ownerVM = self.binding.compiler.vm
2929

30-
// textarea
31-
if (tag === 'TEXTAREA' && el.value) {
32-
el.value = self.compiler.eval(el.value)
33-
}
34-
3530
// determine what event to listen to
3631
self.event =
3732
(self.compiler.options.lazy ||

0 commit comments

Comments
 (0)