mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
71 lines
914 B
Markdown
71 lines
914 B
Markdown
# Loading
|
|
Button has loading status.
|
|
```html
|
|
<n-button
|
|
:loading="loading"
|
|
@click="loading = !loading"
|
|
>
|
|
<template v-slot:icon>
|
|
<md-save />
|
|
</template>
|
|
Loading
|
|
</n-button>
|
|
<br>
|
|
<n-button
|
|
:loading="loading"
|
|
icon-placement="right"
|
|
@click="loading = !loading"
|
|
>
|
|
<template v-slot:icon>
|
|
<md-save />
|
|
</template>
|
|
Loading
|
|
</n-button>
|
|
<br>
|
|
<n-button
|
|
:loading="loading"
|
|
size="small"
|
|
@click="loading = !loading"
|
|
>
|
|
Loading
|
|
</n-button>
|
|
<br>
|
|
<n-button
|
|
:loading="loading"
|
|
size="large"
|
|
@click="loading = !loading"
|
|
>
|
|
Loading
|
|
</n-button>
|
|
<br>
|
|
<n-button
|
|
:loading="loading"
|
|
type="primary"
|
|
size="large"
|
|
round
|
|
@click="loading = !loading"
|
|
>
|
|
Loading
|
|
</n-button>
|
|
```
|
|
|
|
```js
|
|
import mdSave from 'naive-ui/lib/icons/md-save'
|
|
|
|
export default {
|
|
components: {
|
|
mdSave
|
|
},
|
|
data () {
|
|
return {
|
|
loading: false
|
|
}
|
|
}
|
|
}
|
|
```
|
|
```css
|
|
.n-button {
|
|
margin: 0 8px 8px 0;
|
|
}
|
|
```
|