Просмотр исходного кода

remove v-cloak for conditional compiles (fix #1028)

Evan You 10 лет назад
Родитель
Сommit
90cdcdb57f
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/directive.js

+ 4 - 1
src/directive.js

@@ -52,7 +52,10 @@ var p = Directive.prototype
  */
  */
 
 
 p._bind = function (def) {
 p._bind = function (def) {
-  if (this.name !== 'cloak' && this.el && this.el.removeAttribute) {
+  if (
+    (this.name !== 'cloak' || this.vm._isCompiled) &&
+    this.el && this.el.removeAttribute
+  ) {
     this.el.removeAttribute(config.prefix + this.name)
     this.el.removeAttribute(config.prefix + this.name)
   }
   }
   if (typeof def === 'function') {
   if (typeof def === 'function') {