Files
nl_cms-view/src/components/EmptyState.vue
2025-07-29 12:43:09 +08:00

42 lines
1.2 KiB
Vue

<template>
<div class="flex flex-col items-center justify-center py-12 px-4">
<div class="w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center mb-6">
<svg class="w-12 h-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
</svg>
</div>
<h3 class="text-lg font-medium text-gray-900 mb-2">{{ title }}</h3>
<p class="text-gray-500 text-center max-w-sm">{{ description }}</p>
<div v-if="showAction" class="mt-6">
<button
@click="$emit('action')"
class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors"
>
{{ actionText }}
</button>
</div>
</div>
</template>
<script setup>
defineProps({
title: {
type: String,
default: '暂时没有数据'
},
description: {
type: String,
default: '敬请期待更多精彩内容'
},
showAction: {
type: Boolean,
default: false
},
actionText: {
type: String,
default: '刷新'
}
})
defineEmits(['action'])
</script>