From e8b9969f48b1986e80b6a9f97fdb5635ad9793fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Sat, 11 Aug 2018 02:57:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=5F.pushArray();=E4=BC=98?= =?UTF-8?q?=E5=8C=96:class=E6=8C=87=E4=BB=A4,=E6=94=AF=E6=8C=81=E6=8B=86?= =?UTF-8?q?=E8=A1=8C=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/17-:class.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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(':')