naive-ui/demo/documentation/components/pagination/zhCN/disabled.demo.md

39 lines
651 B
Markdown
Raw Normal View History

2020-02-04 11:55:39 +08:00
# 禁用
```html
<n-pagination
2020-09-25 15:40:23 +08:00
v-model:page="page"
2020-02-04 11:55:39 +08:00
:page-count="100"
show-size-picker
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
show-quick-jumper
:disabled="disabled"
2020-09-25 15:40:23 +08:00
@update:page-size="handlePageSizeChange"
2020-02-04 11:55:39 +08:00
:style="{ marginBottom: '12px' }"
/>
<n-switch v-model="disabled" />
```
```js
export default {
2020-10-08 00:13:35 +08:00
inject: ['message'],
2020-02-04 11:55:39 +08:00
data () {
return {
page: 2,
pageSize: 20,
disabled: true
}
},
methods: {
handlePageSizeChange (pageSize) {
this.pageSize = pageSize
2020-10-08 00:13:35 +08:00
this.message.info(`Page size is set to ${pageSize}`)
2020-02-04 11:55:39 +08:00
}
}
}
```
```css
.n-switch {
margin-left: 12px;
}
```