[new feature] ImagePreview: support component call (#3154)
This commit is contained in:
@@ -11,6 +11,14 @@
|
||||
<demo-block :title="$t('button3')">
|
||||
<van-button @click="showImagePreview(0, 1000)">{{ $t('button3') }}</van-button>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('componentCall')">
|
||||
<van-button @click="componentCall">{{ $t('componentCall') }}</van-button>
|
||||
<van-image-preview
|
||||
v-model="show"
|
||||
:images="images"
|
||||
/>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
@@ -29,16 +37,29 @@ export default {
|
||||
'zh-CN': {
|
||||
button1: '预览图片',
|
||||
button2: '指定初始位置',
|
||||
button3: '异步关闭'
|
||||
button3: '异步关闭',
|
||||
componentCall: '组件调用'
|
||||
},
|
||||
'en-US': {
|
||||
button1: 'Show Images',
|
||||
button2: 'Custom Start Position',
|
||||
button3: 'Async Close'
|
||||
button3: 'Async Close',
|
||||
componentCall: 'Component Call'
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
images
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
componentCall() {
|
||||
this.show = true;
|
||||
},
|
||||
|
||||
showImagePreview(position, timer) {
|
||||
const instance = ImagePreview({
|
||||
images,
|
||||
|
||||
Reference in New Issue
Block a user