[new feature] Uploader: support bind v-model
This commit is contained in:
@@ -18,6 +18,14 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-uploader">
|
||||
<div class="van-uploader__wrapper">
|
||||
<div class="van-uploader__upload"><i class="van-icon van-icon-plus van-uploader__upload-icon">
|
||||
<!----></i><input multiple="multiple" type="file" accept="image/*" class="van-uploader__input"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-uploader">
|
||||
<div class="van-uploader__wrapper">
|
||||
|
||||
@@ -127,7 +127,12 @@ it('render upload-text', () => {
|
||||
it('render preview image', async () => {
|
||||
const wrapper = mount(Uploader, {
|
||||
propsData: {
|
||||
preview: true
|
||||
fileList: []
|
||||
},
|
||||
listeners: {
|
||||
input(fileList) {
|
||||
wrapper.setProps({ fileList });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -140,8 +145,13 @@ it('render preview image', async () => {
|
||||
it('max-count prop', async () => {
|
||||
const wrapper = mount(Uploader, {
|
||||
propsData: {
|
||||
preview: true,
|
||||
fileList: [],
|
||||
maxCount: 1
|
||||
},
|
||||
listeners: {
|
||||
input(fileList) {
|
||||
wrapper.setProps({ fileList });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -154,8 +164,13 @@ it('max-count prop', async () => {
|
||||
it('preview-size prop', async () => {
|
||||
const wrapper = mount(Uploader, {
|
||||
propsData: {
|
||||
preview: true,
|
||||
fileList: [],
|
||||
previewSize: 30
|
||||
},
|
||||
listeners: {
|
||||
input(fileList) {
|
||||
wrapper.setProps({ fileList });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user