diff --git a/package.json b/package.json index 8fe2fd9..2dbd591 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anot", - "version": "1.0.1", + "version": "1.0.2", "description": "Anot - 迷你mvvm框架", "main": "dist/anot.js", "files": [ diff --git a/src/17-:class.js b/src/17-:class.js index 916dd47..2f16ba3 100644 --- a/src/17-:class.js +++ b/src/17-:class.js @@ -1,6 +1,7 @@ //类名定义, :class="xx:yy" :class="{xx: yy}" :class="xx" :class="{{xx}}" Anot.directive('class', { init: function(binding) { + binding.expr = binding.expr.replace(/\n/g, ' ').replace(/\s{2,}/g, ' ') var expr = [] if (!/^\{.*\}$/.test(binding.expr)) { expr = binding.expr.split(':')