diff --git a/src/empty/index.js b/src/empty/index.js
index a59d4de40..e99e1bd78 100644
--- a/src/empty/index.js
+++ b/src/empty/index.js
@@ -3,7 +3,7 @@ import Network from './Network';
const [createComponent, bem] = createNamespace('empty');
-const PRESETS = ['error', 'search', 'default'];
+const PRESET_IMAGES = ['error', 'search', 'default'];
export default createComponent({
props: {
@@ -14,56 +14,46 @@ export default createComponent({
},
},
- methods: {
- genImageContent() {
- const slots = this.$slots.image?.();
-
- if (slots) {
- return slots;
+ setup(props, { slots }) {
+ const renderImage = () => {
+ if (slots.image) {
+ return slots.image();
}
- if (this.image === 'network') {
+ let { image } = props;
+
+ if (image === 'network') {
return ;
- },
+ };
- genImage() {
- return
{description}
; } - }, + }; - genBottom() { - const slot = this.$slots.default?.(); - - if (slot) { - return