Skip to content

Commit 85ddd34

Browse files
author
Evan You
committed
add interpolate option
1 parent 95c1c16 commit 85ddd34

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/compiler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Compiler (vm, options) {
4949

5050
// initialize element
5151
var el = compiler.el = compiler.setupElement(options)
52-
log('\nnew VM instance:', el.tagName, '\n')
52+
log('\nnew VM instance: ' + el.tagName + '\n')
5353

5454
// set compiler properties
5555
compiler.vm = el.vue_vm = vm
@@ -399,7 +399,7 @@ CompilerProto.compile = function (node, root) {
399399
compiler.compileNode(node)
400400
}
401401

402-
} else if (nodeType === 3) { // text node
402+
} else if (nodeType === 3 && config.interpolate) { // text node
403403

404404
compiler.compileTextNode(node)
405405

@@ -438,7 +438,7 @@ CompilerProto.compileNode = function (node) {
438438
this.bindDirective(directive)
439439
}
440440
}
441-
} else {
441+
} else if (config.interpolate) {
442442
// non directive attribute, check interpolation tags
443443
exp = TextParser.parseAttr(attr.value)
444444
if (exp) {

src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var prefix = 'v',
1717
silent : false,
1818
enterClass : 'v-enter',
1919
leaveClass : 'v-leave',
20+
interpolate : true,
2021
attrs : {},
2122

2223
get prefix () {

src/utils.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
var config = require('./config'),
22
attrs = config.attrs,
33
toString = ({}).toString,
4-
join = [].join,
54
win = window,
65
console = win.console,
76
timeout = win.setTimeout,
@@ -167,21 +166,21 @@ var utils = module.exports = {
167166
/**
168167
* log for debugging
169168
*/
170-
log: function () {
169+
log: function (msg) {
171170
if (config.debug && console) {
172-
console.log(join.call(arguments, ' '))
171+
console.log(msg)
173172
}
174173
},
175174

176175
/**
177176
* warnings, traces by default
178177
* can be suppressed by `silent` option.
179178
*/
180-
warn: function() {
179+
warn: function (msg) {
181180
if (!config.silent && console) {
182-
console.warn(join.call(arguments, ' '))
183-
if (config.debug) {
184-
console.trace()
181+
console.warn(msg)
182+
if (config.debug && console.trace) {
183+
console.trace(msg)
185184
}
186185
}
187186
},

0 commit comments

Comments
 (0)