|
1 | 1 |
|
2 | 2 | /*!
|
3 |
| - * NativeScript-Vue-Template-Compiler v0.7.0 |
| 3 | + * NativeScript-Vue-Template-Compiler v0.7.1 |
4 | 4 | * (Using Vue v2.5.13)
|
5 | 5 | * (c) 2017-2017 rigor789
|
6 | 6 | * Released under the MIT license.
|
@@ -4053,29 +4053,32 @@ function preTransformNode(el) {
|
4053 | 4053 |
|
4054 | 4054 | addRawAttr(el, ':items', res.for);
|
4055 | 4055 | addRawAttr(el, '+alias', res.alias);
|
| 4056 | + |
| 4057 | + if (res.iterator1) { |
| 4058 | + addRawAttr(el, '+index', res.iterator1); |
| 4059 | + } |
4056 | 4060 | }
|
4057 | 4061 |
|
4058 | 4062 | var listView = {
|
4059 | 4063 | preTransformNode: preTransformNode
|
4060 | 4064 | }
|
4061 | 4065 |
|
4062 | 4066 | function preTransformNode$1(el) {
|
4063 |
| - if (el.tag === 'v-template') { |
4064 |
| - // set +alias property on the v-template component |
4065 |
| - var alias = el.parent.attrsMap['+alias'] || 'item'; |
4066 |
| - addRawAttr(el, '+alias', alias); |
4067 |
| - } |
4068 |
| - |
4069 | 4067 | if (el.parent && el.parent.tag === 'v-template') {
|
4070 |
| - // set the slot scope to the list-view +alias attribute |
4071 |
| - el.slotScope = el.parent.parent.attrsMap['+alias'] || 'item'; |
| 4068 | + var alias = el.parent.parent.attrsMap['+alias'] || 'item'; |
| 4069 | + var index = el.parent.parent.attrsMap['+index'] || '$index'; |
| 4070 | + el.slotScope = buildScopeString(alias, index); |
4072 | 4071 | }
|
4073 | 4072 | }
|
4074 | 4073 |
|
4075 | 4074 | var vTemplate = {
|
4076 | 4075 | preTransformNode: preTransformNode$1
|
4077 | 4076 | }
|
4078 | 4077 |
|
| 4078 | +function buildScopeString(alias, index) { |
| 4079 | + return ("{ " + alias + ", " + index + ", $even, $odd }") |
| 4080 | +} |
| 4081 | + |
4079 | 4082 | // transforms ~test -> v-view:test
|
4080 | 4083 | function transformNode$2(el) {
|
4081 | 4084 | var attr = Object.keys(el.attrsMap).find(function (attr) { return attr.startsWith('~'); });
|
|
0 commit comments