mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
feat(Dialog): add open、close event (#4633)
This commit is contained in:
@@ -1,51 +1,21 @@
|
||||
<template>
|
||||
<demo-section>
|
||||
<demo-block :title="$t('alert1')">
|
||||
<van-button
|
||||
type="primary"
|
||||
@click="onClickAlert"
|
||||
>
|
||||
{{ $t('alert1') }}
|
||||
</van-button>
|
||||
<van-button
|
||||
type="primary"
|
||||
@click="onClickAlert2"
|
||||
>
|
||||
{{ $t('alert2') }}
|
||||
</van-button>
|
||||
<van-button type="primary" @click="onClickAlert">{{ $t('alert1') }}</van-button>
|
||||
<van-button type="primary" @click="onClickAlert2">{{ $t('alert2') }}</van-button>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('confirm')">
|
||||
<van-button
|
||||
type="primary"
|
||||
@click="onClickConfirm"
|
||||
>
|
||||
{{ $t('confirm') }}
|
||||
</van-button>
|
||||
<van-button type="primary" @click="onClickConfirm">{{ $t('confirm') }}</van-button>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('asyncClose')">
|
||||
<van-button
|
||||
type="primary"
|
||||
@click="onClickAsyncClose"
|
||||
>
|
||||
{{ $t('asyncClose') }}
|
||||
</van-button>
|
||||
<van-button type="primary" @click="onClickAsyncClose">{{ $t('asyncClose') }}</van-button>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('componentCall')">
|
||||
<van-button
|
||||
type="primary"
|
||||
@click="show = true"
|
||||
>
|
||||
{{ $t('componentCall') }}
|
||||
</van-button>
|
||||
<van-dialog
|
||||
v-model="show"
|
||||
:title="$t('title')"
|
||||
show-cancel-button
|
||||
:lazy-render="false"
|
||||
>
|
||||
<van-button type="primary" @click="show = true">{{ $t('componentCall') }}</van-button>
|
||||
<van-dialog v-model="show" :title="$t('title')" show-cancel-button :lazy-render="false">
|
||||
<img :src="image">
|
||||
</van-dialog>
|
||||
</demo-block>
|
||||
@@ -68,7 +38,7 @@ export default {
|
||||
alert2: 'Alert without title',
|
||||
confirm: 'Confirm dialog',
|
||||
asyncClose: 'Async Close',
|
||||
componentCall: 'Component Call',
|
||||
componentCall: 'Component Call'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -121,7 +91,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import "../../style/var";
|
||||
@import '../../style/var';
|
||||
|
||||
.demo-dialog {
|
||||
background-color: @white;
|
||||
|
Reference in New Issue
Block a user