From a250b6216753cfd0c0622a1fbc0f3254fc8e0a4f Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 19 Mar 2024 18:39:44 +0800
Subject: [PATCH] 图片预览组件,支持图片显示

---
 bases/Pilot.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/bases/Pilot.js b/bases/Pilot.js
index f5208f8..6dcacf0 100644
--- a/bases/Pilot.js
+++ b/bases/Pilot.js
@@ -21,10 +21,15 @@
             methods: {},
         };
         const names = [];
+        let parent = null;
         // 实例本身的字段
         Object.getOwnPropertyNames(this).forEach(name => names.push(name));
-        // 类的字段
-        Object.getOwnPropertyNames(Object.getPrototypeOf(this)).forEach(name => names.push(name));
+        // 基类的字段,直到Pilot为止(不含Pilot)
+        parent = Object.getPrototypeOf(this);
+        while (parent instanceof Pilot) {
+            Object.getOwnPropertyNames(parent).forEach(name => names.push(name));
+            parent = Object.getPrototypeOf(parent);
+        }
         // 传递
         names.forEach(name => {
             // 构造器忽略,如果存在属性 $methods 也忽略

--
Gitblit v1.9.1