feat(Dialog): add open、close event (#4633)

This commit is contained in:
neverland
2019-09-30 10:55:50 +08:00
committed by GitHub
parent 48bd6d86d8
commit 02a81a1ac3
5 changed files with 34 additions and 62 deletions

View File

@@ -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;