@@ -48,8 +48,11 @@ function Directive (definition, expression, rawKey, compiler, node) {
return
}
- this.expression = expression.trim()
- this.rawKey = rawKey
+ this.expression = (
+ this.isLiteral
+ ? compiler.eval(expression)
+ : expression
+ ).trim()
parseKey(this, rawKey)
@@ -68,14 +68,15 @@ module.exports = {
ref: {
isLiteral: true,
bind: function () {
- var id = this.id = this.compiler.eval(this.expression)
+ var id = this.expression
if (id) {
this.vm.$parent.$[id] = this.vm
},
unbind: function () {
- if (this.id) {
- delete this.vm.$parent.$[this.id]
+ if (id) {
+ delete this.vm.$parent.$[id]
@@ -7,7 +7,7 @@ module.exports = {
var compiler = this.compiler,
- id = this.id = compiler.eval(this.expression)
+ id = this.expression
if (!id) return
var partial = id === 'yield'