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

Merge pull request #300 from dmfilipenko/fix/directive-style

#299 fix derective style
Evan You 12 лет назад
Родитель
Сommit
de8ec61312
1 измененных файлов с 7 добавлено и 5 удалено
  1. 7 5
      src/directives/style.js

+ 7 - 5
src/directives/style.js

@@ -19,11 +19,13 @@ module.exports = {
     update: function (value) {
         var prop = this.prop
         if (prop) {
-            var isImportant = value.slice(-10) === '!important'
-                ? 'important'
-                : ''
-            if (isImportant) {
-                value = value.slice(0, -10).trim()
+            if (value){
+                var isImportant = value.slice(-10) === '!important'
+                    ? 'important'
+                    : ''
+                if (isImportant) {
+                    value = value.slice(0, -10).trim()
+                }
             }
             this.el.style.setProperty(prop, value, isImportant)
             if (this.prefixed) {