[new feature] Uploader: add preview-size prop

This commit is contained in:
陈嘉涵
2019-06-05 09:44:27 +08:00
parent af4dea96ed
commit 5dee1eb22f
6 changed files with 50 additions and 4 deletions
@@ -11,6 +11,19 @@ exports[`max-count prop 1`] = `
</div>
`;
exports[`preview-size prop 1`] = `
<div class="van-uploader">
<div class="van-uploader__wrapper">
<div class="van-image van-uploader__preview" style="width: 30px; height: 30px;"><img src="test" class="van-image__img" style="object-fit: cover;">
<div class="van-image__loading"><i class="van-icon van-icon-photo-o" style="font-size: 22px;">
<!----></i></div>
</div>
<div class="van-uploader__upload" style="width: 30px; height: 30px;"><i class="van-icon van-icon-plus van-uploader__upload-icon">
<!----></i><input type="file" accept="image/*" class="van-uploader__input"></div>
</div>
</div>
`;
exports[`render preview image 1`] = `
<div class="van-uploader">
<div class="van-uploader__wrapper">
+14
View File
@@ -150,3 +150,17 @@ it('max-count prop', async () => {
expect(wrapper).toMatchSnapshot();
});
it('preview-size prop', async () => {
const wrapper = mount(Uploader, {
propsData: {
preview: true,
previewSize: 30
}
});
wrapper.vm.onChange(file);
await later();
expect(wrapper).toMatchSnapshot();
});