不是。对于支持 `.sync` 修饰符的属性,我们会在文档的 API 表格中注明。更多 `.sync` 的用法请查看 [Vue 文档](https://vuejs.org/v2/guide/components.html#sync-Modifier)。
</details>
<details>
<summary>你们的文档怎么偷偷更新了?</summary>
...
...
@@ -144,6 +150,12 @@ Now you can use them as you do with built-in icons. For example, in `el-input`:
```
</details>
<details>
<summary>Can I use `.sync` modifier on every attribute?</summary>
No, only a few attributes supports the `.sync` modifier, and we have explicitly marked them on the documentation's API table. For more information about `.sync`, please refer to [Vue documentation](https://vuejs.org/v2/guide/components.html#sync-Modifier).
</details>
<details>
<summary>When do you update documentations of Element?</summary>
this.$confirm('Are you sure to close this dialog?')
.then(_ => {
...
...
@@ -58,14 +55,14 @@ Informs users while preserving the current page state.
Dialog pops up a dialog box, and it's quite customizable.
:::demo Set the `v-model` attribute with a `Boolean`, and Dialog shows when it is `true`. The Dialog has two parts: `body` and `footer`, and the latter requires a `slot` named `footer`. The optional `title` attribute (empty by default) is for defining a title. This example explicitly changes the value of `v-model` to toggle Dialog. In addition, we also provide `open` and `close` method, which you can call to open/close the Dialog. Finally, this example demonstrates how `before-close` is used.
:::demo Set the `visible` attribute with a `Boolean`, and Dialog shows when it is `true`. The Dialog has two parts: `body` and `footer`, and the latter requires a `slot` named `footer`. The optional `title` attribute (empty by default) is for defining a title. Finally, this example demonstrates how `before-close` is used.
```html
<el-buttontype="text"@click="dialogVisible = true">click to open the Dialog</el-button>
<el-dialog
title="Tips"
v-model="dialogVisible"
:visible.sync="dialogVisible"
size="tiny"
:before-close="handleClose">
<span>This is a message</span>
...
...
@@ -106,7 +103,7 @@ The content of Dialog can be anything, even a table or a form. This example show
<!-- Table -->
<el-buttontype="text"@click="dialogTableVisible = true">open a Table nested Dialog</el-button>
@@ -50,7 +50,7 @@ Add more modules based on your scenario.
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage1"
:current-page.sync="currentPage1"
:page-size="100"
layout="total, prev, pager, next"
:total="1000">
...
...
@@ -61,7 +61,7 @@ Add more modules based on your scenario.
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage2"
:current-page.sync="currentPage2"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
layout="sizes, prev, pager, next"
...
...
@@ -73,7 +73,7 @@ Add more modules based on your scenario.
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage3"
:current-page.sync="currentPage3"
:page-size="100"
layout="prev, pager, next, jumper"
:total="1000">
...
...
@@ -84,7 +84,7 @@ Add more modules based on your scenario.
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:current-page.sync="currentPage4"
:page-sizes="[100, 200, 300, 400]"
:page-size="100"
layout="total, sizes, prev, pager, next, jumper"
...
...
@@ -99,7 +99,6 @@ Add more modules based on your scenario.
console.log(`${val} items per page`);
},
handleCurrentChange(val){
this.currentPage=val;
console.log(`current page: ${val}`);
}
},
...
...
@@ -131,7 +130,6 @@ Add more modules based on your scenario.
console.log(`${val} items per page`);
},
handleCurrentChange(val) {
this.currentPage = val;
console.log(`current page: ${val}`);
}
},
...
...
@@ -154,7 +152,7 @@ Add more modules based on your scenario.
| page-size | item count of each page | number | — | 10 |
| total | total item count | number | — | — |
| page-count | total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required | number | — | — |
| current-page | current page number | number | — | 1 |
| current-page | current page number, supports the .sync modifier | number | — | 1 |
| layout | layout of Pagination, elements separated with a comma | string | `sizes`, `prev`, `pager`, `next`, `jumper`, `->`, `total`, `slot` | 'prev, pager, next, jumper, ->, total' |