空列表
This commit is contained in:
BIN
src/assets/images/brand-null.png
Normal file
BIN
src/assets/images/brand-null.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
@@ -1,19 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sc-list-null">
|
<div class="sc-list-null">
|
||||||
<img src="@/assets/images/shopping-cart-null.png" alt="" />
|
<img v-if="nullImage === 'shopping-cart'" src="@/assets/images/shopping-cart-null.png" />
|
||||||
<div class="title">Your Cart is empty</div>
|
<img v-else-if="nullImage === 'brand'" src="@/assets/images/brand-null.png" />
|
||||||
<div class="tip">Discover new fashion assets and add them to your cart.</div>
|
<div class="title">{{ title }}</div>
|
||||||
<button custom v-show="showButton" @click="handleExploreClick">EXPLORE DIGITAL ITEMS</button>
|
<div class="tip">{{ tip }}</div>
|
||||||
|
<button custom v-show="showButton" @click="handleClick">{{ buttonText }}</button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, onMounted } from 'vue'
|
import { computed, ref, onMounted } from 'vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
showButton: { type: Boolean, default: true }
|
nullImage: { type: String as () => 'shopping-cart' | 'brand', default: 'shopping-cart' },
|
||||||
|
title: { type: String, default: '' },
|
||||||
|
tip: { type: String, default: '' },
|
||||||
|
showButton: { type: Boolean, default: true },
|
||||||
|
buttonText: { type: String, default: 'EXPLORE DIGITAL ITEMS' }
|
||||||
})
|
})
|
||||||
const handleExploreClick = () => {
|
const emit = defineEmits(['explore'])
|
||||||
console.log('探索')
|
const handleClick = () => {
|
||||||
|
console.log('emit("explore")')
|
||||||
|
emit('explore')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<sc-list-null v-show="list.length === 0" :show-button="!isMini" />
|
<sc-list-null
|
||||||
|
v-show="list.length === 0"
|
||||||
|
:show-button="!isMini"
|
||||||
|
title="Your Cart is empty"
|
||||||
|
tip="Discover new fashion assets and add them to your cart."
|
||||||
|
/>
|
||||||
<sc-item
|
<sc-item
|
||||||
v-for="v in list"
|
v-for="v in list"
|
||||||
:key="v.id"
|
:key="v.id"
|
||||||
|
|||||||
Reference in New Issue
Block a user