该组件支持以plugin
形式调用:
import { LoadingPlugin } from 'vux'
Vue.use(LoadingPlugin)
// 或者umd方式
// 引入构建的js文件
Vue.use(vuxLoadingPlugin)
// 显示
this.$vux.loading.show({
text: 'Loading'
})
// 隐藏
this.$vux.loading.hide()
// 获取显示状态
this.$vux.loading.isVisible() // true or false, v2.9.1 版本支持
loading同样支持在vue外直接使用,请参照 https://github.com/airyland/vux/blob/v2/docs/examples/loading.html
从v2.7.8版本开始以组件形式调用增加delay
参数,从而实现延时显示.
API
Variables
Props
name | type | default | description | required version |
show | boolean | false | visibility of the component. Use v-model for binding before v2.5.7, otherwise use :show | -- |
text | string | 加载中 | loading text, use empty string to hide loading text | -- |
position | string | fixed | position, default is fixed , you can use absolute | -- |
transition | string | vux-mask | transition name | -- |
Slots
name | description | required version |
default | content area | -- |
Variables
name | default | description | inherited name |
@loading-z-index | 5001 | z-index |
Contributors
Contributors
Total commits quantity: 25,Total contributors quantity: 4
airylandKwanlichunqiangQiongrong JiangChangelog
Releases
- v2.9.1 [feature] add isVisible function for LoadingPlugin #2704
- v2.9.1 [fix] fix covered by element when using scroll plugins
- v2.9.0 [fix] add variable loading-z-index #2484
- v2.9.0 [enhance] support using empty text to hide loading text #2566
- v2.5.7 [fix] fix [email protected] no setter warning, use :show instead of v-model #1798
- v2.5.0 [feature] Add prop:transition
- v2.1.1-rc.11 [enhance] Reset prop data when used as plugin
- v2.1.1-rc.11 [enhance] Add fade transition