[new feature] Dialog: support component call (#593)

This commit is contained in:
neverland
2018-01-31 11:22:00 +08:00
committed by GitHub
parent 9df66da212
commit aa4f03a15d
11 changed files with 211 additions and 53 deletions
+29 -1
View File
@@ -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;
}
}