ant-design-vue/components/button/demo/loading.vue

43 lines
898 B
Vue
Raw Normal View History

2017-11-03 18:46:18 +08:00
<template>
<div>
<AntButton type="primary" loading>
Loading
</AntButton>
<AntButton type="primary" size="small" loading>
Loading
</AntButton>
<br />
2017-12-29 16:51:06 +08:00
<AntButton type="primary" :loading="loading" @mouseenter="enterLoading">
mouseenter me!
2017-11-03 18:46:18 +08:00
</AntButton>
<AntButton type="primary" icon="poweroff" :loading="iconLoading" @click="enterIconLoading">
2017-12-29 16:51:06 +08:00
延迟1s
2017-11-03 18:46:18 +08:00
</AntButton>
<br />
<AntButton shape="circle" loading />
<AntButton type="primary" shape="circle" loading />
</div>
</template>
<script>
import { Button } from 'antd'
export default {
data () {
return {
loading: false,
iconLoading: false,
}
},
methods: {
enterLoading () {
this.loading = true
},
enterIconLoading () {
2017-12-29 16:51:06 +08:00
this.iconLoading = { delay: 1000 }
2017-11-03 18:46:18 +08:00
},
},
components: {
AntButton: Button,
},
}
</script>