(el)
| 13601 | |
| 13602 | //判断获取v-for属性是否存在如果有则转义 v-for指令 把for,alias,iterator1,iterator2属性添加到虚拟dom中 |
| 13603 | function processFor(el) { |
| 13604 | var exp; |
| 13605 | //获取v-for指令 属性 |
| 13606 | if ((exp = getAndRemoveAttr(el, 'v-for'))) { |
| 13607 | console.log(exp) |
| 13608 | |
| 13609 | //转换 for指令 获取 for中的key 返回一个res对象为{for:data字符串,alias:value字符串,iterator1:key字符串,iterator2:index字符串} |
| 13610 | var res = parseFor(exp); |
| 13611 | |
| 13612 | if (res) { |
| 13613 | //合并浅拷贝到el中 |
| 13614 | extend(el, res); |
| 13615 | } else { |
| 13616 | warn$2( |
| 13617 | ("Invalid v-for expression: " + exp) |
| 13618 | ); |
| 13619 | } |
| 13620 | } |
| 13621 | } |
| 13622 | |
| 13623 | //转换 for指令 获取 for中的key 返回一个res对象为{for:data字符串,alias:value字符串,iterator1:key字符串,iterator2:index字符串} |
| 13624 | function parseFor(exp //字符串 列如 是 (item,index) in data 或 item in data 或item of data 或者(item,index) of data |
no test coverage detected