| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <template>
- <!-- 全局 空提示 -->
- <view class="ui-empty center" :style="{marginTop:top+'px'}" v-if="show">
- <image src="@/static/empty/content.png" class="empty-icon" mode="widthFix"></image>
- <text class="center ui-empty__text">{{text}}</text>
- <view class="center ui-empty__wrap" v-if="$slots.default || $slots.$default">
- <slot />
- </view>
- </view>
- </template>
- <script>
- /**
- * empty 内容为空
- */
- export default {
- name: "ui-empty",
- data() {
- return {
-
- }
- },
-
- props: {
-
- text: {
- type: String,
- default: '暂无内容'
- },
- // 顶部距离
- top: {
- type: Number,
- default: 100
- },
- // 是否显示组件
- show: {
- type: Boolean,
- default: true
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .center {
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .ui-empty {
- flex-direction: column;
- &__text {
- font-size: 32rpx;
- margin-top: 10rpx;
- color: #999;
- }
- &__wrap {
- flex-direction: column;
- color: #999;
- font-size: 26rpx;
- margin-top: 10rpx;
- }
- }
- .empty-icon {
- width: 260rpx;
- height: 260rpx;
- }
- .select-btn {
- margin-top: 50rpx;
- color: $color-primary;
- font-size: 26rpx;
- border-radius: 50rpx;
- border-color: $color-primary;
- }
- </style>
|