mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[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;
|
||||
}
|
||||
}
|
||||
|
@@ -68,13 +68,9 @@ export default {
|
||||
title3: '禁用输入框',
|
||||
title4: '错误提示',
|
||||
title5: '高度自适应',
|
||||
username: '用户名',
|
||||
password: '密码',
|
||||
message: '留言',
|
||||
phone: '手机号',
|
||||
phonePlaceholder: '请输入手机号',
|
||||
usernamePlaceholder: '请输入用户名',
|
||||
passwordPlaceholder: '请输入密码',
|
||||
messagePlaceholder: '请输入留言',
|
||||
inputDisabled: '输入框已禁用',
|
||||
phoneError: '手机号格式错误'
|
||||
@@ -84,13 +80,9 @@ export default {
|
||||
title3: 'Disabled',
|
||||
title4: 'Error info',
|
||||
title5: 'Auto resize',
|
||||
username: 'Username',
|
||||
password: 'Password',
|
||||
message: 'Message',
|
||||
phone: 'Phone',
|
||||
phonePlaceholder: 'Phone',
|
||||
usernamePlaceholder: 'Username',
|
||||
passwordPlaceholder: 'Password',
|
||||
messagePlaceholder: 'Message',
|
||||
inputDisabled: 'Disabled',
|
||||
phoneError: 'Invalid phone'
|
||||
|
Reference in New Issue
Block a user