vue-server
Advanced tools
Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "vue-server", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Vue.js server side version", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -96,3 +96,3 @@ var cssParser = require('../css'); | ||
if (content) { | ||
compilers.compileElements(vm.$parent, content); | ||
compilers.compileElements(vm.__states.parent, content); | ||
slotContent.insert(vm, element, content); | ||
@@ -99,0 +99,0 @@ } |
@@ -31,2 +31,18 @@ var wrapComponent = require('./../wrapComponent.js'); | ||
}, | ||
componentVFor: { | ||
template: tools.getTpl(__dirname + '/component-v-for.html', true), | ||
data: function() { | ||
return { | ||
title: 'test', | ||
value: [1] | ||
}; | ||
}, | ||
components: { | ||
test: { | ||
template: '<i><slot></slot></i>' | ||
} | ||
} | ||
}, | ||
itemComplex: { | ||
@@ -178,2 +194,22 @@ template: '<i><item2 v-for="n in 1">333</item2></i>', | ||
}); | ||
describe('slot inside v-for', function () { | ||
it('when v-for is on component should use v-for data context', function () { | ||
expect($('#component-v-for-1').html()).toEqual( | ||
'<i>1</i>' | ||
); | ||
}); | ||
it('when v-for is on a tag with component inside should use v-for data context', function () { | ||
expect($('#component-v-for-2').html()).toEqual( | ||
'<div><i>1</i></div>' | ||
); | ||
}); | ||
it('when v-for is on component should use parent component data context', function () { | ||
expect($('#component-v-for-3').html()).toEqual( | ||
'<i>test</i>' | ||
); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
316698
79
7789