feat(List): add error slot

This commit is contained in:
陈嘉涵
2019-12-26 20:35:16 +08:00
committed by neverland
parent 8a0705d761
commit e9a9388202
5 changed files with 32 additions and 6 deletions
@@ -1,5 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`error slot 1`] = `
<div role="feed" class="van-list">
<div class="van-list__error-text">Custom Error</div>
<div class="van-list__placeholder"></div>
</div>
`;
exports[`finished slot 1`] = `
<div role="feed" class="van-list">
<div class="van-list__finished-text">Custom Finished</div>
+13
View File
@@ -83,6 +83,19 @@ test('finished slot', async () => {
expect(wrapper).toMatchSnapshot();
});
test('error slot', async () => {
const wrapper = mount(List, {
propsData: {
error: true
},
scopedSlots: {
error: () => 'Custom Error'
}
});
expect(wrapper).toMatchSnapshot();
});
test('immediate check false', async () => {
const wrapper = mount(List, {
propsData: {