This repository has been archived on 2023-08-29. You can view files and clone it, but cannot push or open issues/pull-requests.
yutent
/
anot.js
Archived
1
0
Fork 0

优化_.pushArray();优化:class指令,支持拆行写

1.x 1.0.2
宇天 2018-08-11 02:57:47 +08:00
parent ab32fb611e
commit e8b9969f48
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "anot",
"version": "1.0.1",
"version": "1.0.2",
"description": "Anot - 迷你mvvm框架",
"main": "dist/anot.js",
"files": [

View File

@ -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(':')