ant-design-vue/components/modal/demo/locale.md

51 lines
1.0 KiB
Markdown
Raw Normal View History

2018-03-07 13:36:15 +00:00
<cn>
#### 国际化
设置 `okText``cancelText` 以自定义按钮文字。
</cn>
<us>
#### Internationalization
To customize the text of the buttons, you need to set `okText` and `cancelText` props.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2018-03-07 13:36:15 +00:00
<template>
<div>
<a-button type="primary" @click="showModal">Modal</a-button>
2019-09-28 12:45:07 +00:00
<a-modal title="Modal" v-model="visible" @ok="hideModal" okText="确认" cancelText="取消">
2018-03-07 13:36:15 +00:00
<p>Bla bla ...</p>
<p>Bla bla ...</p>
<p>Bla bla ...</p>
</a-modal>
<br />
<br />
<a-button @click="confirm">Confirm</a-button>
</div>
</template>
<script>
2019-09-28 12:45:07 +00:00
export default {
data() {
return {
visible: false,
};
2018-03-07 13:36:15 +00:00
},
2019-09-28 12:45:07 +00:00
methods: {
showModal() {
this.visible = true;
},
hideModal() {
this.visible = false;
},
confirm() {
this.$confirm({
title: 'Confirm',
content: 'Bla bla ...',
okText: '确认',
cancelText: '取消',
});
},
2018-03-07 13:36:15 +00:00
},
2019-09-28 12:45:07 +00:00
};
2018-03-07 13:36:15 +00:00
</script>
```