Files
xk-doctor-wx/components/d-empty/d-empty.vue
李琦 eacca1bf7b 1. 开方线上功能基本完成
2. 修复了一些抽屉组件的滑动失效问题
2026-05-14 14:29:51 +08:00

73 lines
1.3 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="box">
<image :src="image?image:images[mode]"></image>
<slot v-if="!text">
<view class="hiht">暂无商品<text @click="$emit('click')">添加商品</text></view>
</slot>
<view class="hiht" v-if="text" @click="$emit('click')">{{text}}</view>
</view>
</template>
<script>
/**
* steps 内容为空
* @description 该组件用于需要加载内容,但是加载的第一页数据就为空,提示一个"没有内容"的场景
* @property {String} mode 设置模式默认list
*/
export default {
name: 'd-empty',
props: {
mode: {
type: String,
default: 'list'
},
text: {
type: String,
default: ''
},
image: {
type: String,
default: ''
},
images: {
type: [Object,Array],
default: () => {
return {
'list': '../../static/image/list.png',
'search': '../../static/image/search.png'
}
}
}
},
}
</script>
<style lang="scss" scoped>
.box {
padding: 32rpx 0;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
image {
width: 200rpx;
height: 173rpx;
}
.hiht {
display: flex;
justify-content: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #6C7380;
margin-top: 32rpx;
text-align: center;
text {
color: #6ACDBB;
}
}
</style>