Skip to content

Commit 2d84461

Browse files
committed
build: 0.7.1
1 parent 14e5ed4 commit 2d84461

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

packages/nativescript-vue-template-compiler/index.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*!
3-
* NativeScript-Vue-Template-Compiler v0.7.0
3+
* NativeScript-Vue-Template-Compiler v0.7.1
44
* (Using Vue v2.5.13)
55
* (c) 2017-2017 rigor789
66
* Released under the MIT license.
@@ -4053,29 +4053,32 @@ function preTransformNode(el) {
40534053

40544054
addRawAttr(el, ':items', res.for);
40554055
addRawAttr(el, '+alias', res.alias);
4056+
4057+
if (res.iterator1) {
4058+
addRawAttr(el, '+index', res.iterator1);
4059+
}
40564060
}
40574061

40584062
var listView = {
40594063
preTransformNode: preTransformNode
40604064
}
40614065

40624066
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-
40694067
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);
40724071
}
40734072
}
40744073

40754074
var vTemplate = {
40764075
preTransformNode: preTransformNode$1
40774076
}
40784077

4078+
function buildScopeString(alias, index) {
4079+
return ("{ " + alias + ", " + index + ", $even, $odd }")
4080+
}
4081+
40794082
// transforms ~test -> v-view:test
40804083
function transformNode$2(el) {
40814084
var attr = Object.keys(el.attrsMap).find(function (attr) { return attr.startsWith('~'); });

packages/nativescript-vue-template-compiler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-vue-template-compiler",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "template compiler for nativescript-vue",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)