Переглянути джерело

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

#299 fix derective style
Evan You 12 роки тому
батько
коміт
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) {