[new feature] Dialog: support component call (#593)
This commit is contained in:
@@ -8,6 +8,26 @@
|
||||
<demo-block :title="$t('title2')">
|
||||
<van-button @click="onClickConfirm">Confirm</van-button>
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('advancedUsage')">
|
||||
<van-button @click="show = true">{{ $t('advancedUsage') }}</van-button>
|
||||
<van-dialog
|
||||
v-model="show"
|
||||
@confirm="show = false"
|
||||
>
|
||||
<van-field
|
||||
v-model="username"
|
||||
:label="$t('username')"
|
||||
:placeholder="$t('usernamePlaceholder')"
|
||||
/>
|
||||
<van-field
|
||||
v-model="password"
|
||||
type="password"
|
||||
:label="$t('password')"
|
||||
:placeholder="$t('passwordPlaceholder')"
|
||||
/>
|
||||
</van-dialog>
|
||||
</demo-block>
|
||||
</demo-section>
|
||||
</template>
|
||||
|
||||
@@ -26,6 +46,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
username: '',
|
||||
password: ''
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClickAlert() {
|
||||
Dialog.alert({
|
||||
@@ -52,7 +80,7 @@ export default {
|
||||
|
||||
<style lang="postcss">
|
||||
.demo-dialog {
|
||||
.van-button {
|
||||
.van-doc-demo-block > .van-button {
|
||||
margin: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user