空页面
默认展示
vue
<template>
<jp-empty></jp-empty>
</template>
slot 的使用
vue
<template>
<jp-empty :img="attribute.emptyImg" :title="attribute.title" :subtitle="attribute.subtitle" margin-top="0px" @titleClick="titleClick">
<template #action>
<jp-button type="primary" style="margin-top: 8px" size="medium">操作按钮</jp-button>
</template>
</jp-empty>
</template>
<script lang="ts" setup>
import { reactive } from 'vue'
const attribute = reactive({
title: '',
subtitle: '没有搜索到门店哦~',
showSlot: false,
emptyImg: '/static/example/img_store.png'
})
const titleClick = () => {
console.log('titleClick')
}
</script>
props
属性名 | 类型 | 默认值 |
---|---|---|
img | String | '组件默认' |
title | String | '暂无数据' |
subtitle | String | |
marginTop | String | 100px |
点击事件 |
---|
title-click |