使用vue封装一个全局loading…
主要使用vuex状态管理来实现
loading.vue代码
<!--状态 图片 文字-->
<template>
<div v-if="msg.status">
<div class="mark"></div>
<div class="load-container loading-box">
<img width="50px" height="50px" src="../assets/images/loading_2.gif" alt="">
<div class="p-3 text_conter f20">{
{
this.$store.state.LOADING_txt}}</div>
</div>
</div>
</template>
<script>
export default {
name: "loading.vue",
props: {
msg: {
type: Object, //指定传入的类型
default: {
status:true,
txt:'加载中...'
} //是否显示的状态值 内容
}
}
}
</script>
<style scoped>
.loading-box{
background: #fff;
/*width: 250px;*/
height: 100px;
position