naive-ui/demo/documentation/components/spin/enUS/wrap.demo.md

58 lines
1.1 KiB
Markdown
Raw Normal View History

2019-10-15 17:40:21 +08:00
# Wrap
2020-01-31 21:58:21 +08:00
You can wrap a component inside spin. To match regular components's size, spin alse provides `in-small`, `in-medium` and `in-large` sizes.
2019-10-15 17:40:21 +08:00
```html
2020-10-22 21:39:56 +08:00
<div>
2019-10-15 17:40:21 +08:00
<n-spin
2020-02-11 14:44:29 +08:00
style="display: inline-block; margin: 0 8px 12px 0;"
2019-10-15 17:40:21 +08:00
size="in-small"
:spinning="spinning"
>
<n-button size="small">
2020-01-31 21:58:21 +08:00
in small
2019-10-15 17:40:21 +08:00
</n-button>
</n-spin>
<n-spin
2020-02-11 14:44:29 +08:00
style="display: inline-block; margin: 0 8px 12px 0;"
2019-10-15 17:40:21 +08:00
size="in-medium"
:spinning="spinning"
>
<n-button size="medium">
2020-01-31 21:58:21 +08:00
in medium
2019-10-15 17:40:21 +08:00
</n-button>
</n-spin>
<n-spin
2020-02-11 14:44:29 +08:00
style="display: inline-block; margin: 0 8px 12px 0;"
2019-10-15 17:40:21 +08:00
size="in-large"
:spinning="spinning"
>
<n-button size="large">
2020-01-31 21:58:21 +08:00
in large
2019-10-15 17:40:21 +08:00
</n-button>
</n-spin>
<n-spin
:spinning="spinning"
>
<n-alert
2020-01-31 21:58:21 +08:00
title="La La La"
2019-10-15 17:40:21 +08:00
type="success"
>
2020-01-31 21:58:21 +08:00
Leave it till tomorrow to unpack my case. Honey disconnect the phone.
2019-10-15 17:40:21 +08:00
</n-alert>
</n-spin>
</div>
2020-01-31 21:58:21 +08:00
<n-button @click="spinning = !spinning">Click to Spin</n-button>
2019-10-15 17:40:21 +08:00
```
```js
export default {
data () {
return {
spinning: false
}
}
}
2020-01-31 21:58:21 +08:00
```
```css
.n-alert {
margin: 0 0 12px 0;
}
2019-10-15 17:40:21 +08:00
```