组件:loading.vue

<template>
	<view>
		<view class="cu-load load-modal" v-if="loadModal">
			<!-- <view class="cuIcon-emojifill text-orange"></view> -->
			<image src="/static/logo.png" mode="aspectFit"></image>
			<view class="gray-text">加载中...</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		loadModal: true
	},
	data() {
		return {};
	},
	methods: {
		LoadModal(e) {
			this.loadModal = true;
			setTimeout(() => {
				this.loadModal = false;
			}, 2000);
		}
	}
};
</script>

<style></style>

 引用:

引入
import Loading from '../../../components/loading/loading.vue';

注册
components:{
		Loading
},

加载 传值
<Loading :loadModal="loadModal"></Loading>

loadModal:false,

 

Logo

前往低代码交流专区

更多推荐