< template >
< div id= "loadingToast" class= "weui_loading_toast" v-show="show" >
< div class= "weui_mask_transparent" ></ div >
< div class= "weui_toast" >
< div class= "weui_loading" >
< div class= "weui_loading_leaf weui_loading_leaf_1" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_2" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_3" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_4" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_5" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_6" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_7" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_8" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_9" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_10" ></ div >
< div class= "weui_loading_leaf weui_loading_leaf_11" ></ div >
</ div >
< p class= "weui_toast_content" >{{text}} < slot ></ slot ></ p >
</ div >
</ div >
</ template >

< script >
export default {
props: {
show: {
type: Boolean,
default: false
},
text: {
type: String,
default: 'Loading'
}
}
}
</ script >
调用
< loading :show="show1" :text="text1" ></ loading >

< script >
import loading from './loading.vue'
export default{
data(){
return{
show1: true,
text1: '加载中...'
}
},
components: { "loading":loading},
created(){
this.$ajax.post( 'url').then((res) => {
this .show1= false ;
})

}

</ script >


Logo

前往低代码交流专区

更多推荐