| | |
| | | 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 也忽略 |
| | |
| | | const nextPage = currentPages[pageIndex + 1]; |
| | | if (nextPage) { |
| | | clearInterval(timer); |
| | | nextPage.$component.$onMessage(action, nextData); |
| | | nextPage.$component?.$onMessage(action, nextData); |
| | | } |
| | | }, 50); |
| | | } else if (pageType === 'prevPage') { |
| | |
| | | const pageIndex = currentPages.findIndex(page => page.$component === $vm); |
| | | const prevPage = currentPages[pageIndex - 1]; |
| | | if (prevPage) { |
| | | prevPage.$component.$onMessage(action, nextData); |
| | | prevPage.$component?.$onMessage(action, nextData); |
| | | } |
| | | } else if (pageType === 'rootPage') { |
| | | const currentPages = getCurrentPages(); |
| | | const rootPage = currentPages[0]; |
| | | rootPage.$component.$onMessage(action, nextData); |
| | | rootPage.$component?.$onMessage(action, nextData); |
| | | } |
| | | }; |
| | | } |