Skip to content

Commit

Permalink
fix(1.0.0-beta.1): Fixed an issue where the antd drawer component fai…
Browse files Browse the repository at this point in the history
…led to render
  • Loading branch information
bailicangdu committed Mar 23, 2023
1 parent 11e0f8e commit bab8c07
Show file tree
Hide file tree
Showing 17 changed files with 272 additions and 65 deletions.
30 changes: 15 additions & 15 deletions dev/children/react16/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,27 @@ window.onunmount = () => {
}

/* ---------------------- 全局事件 --------------------- */
document.addEventListener('click', function () {
console.log(`子应用${window.__MICRO_APP_NAME__}内部的document.addEventListener绑定`)
}, false)
// document.addEventListener('click', function () {
// console.log(`子应用${window.__MICRO_APP_NAME__}内部的document.addEventListener绑定`)
// }, false)

document.onclick = () => {
console.log(`子应用${window.__MICRO_APP_NAME__}内部的document.onclick绑定`)
}
// document.onclick = () => {
// console.log(`子应用${window.__MICRO_APP_NAME__}内部的document.onclick绑定`)
// }

window.addEventListener('click', () => {
console.log(`子应用${window.__MICRO_APP_NAME__}内部的window.addEventListener绑定`)
}, false)
// window.addEventListener('click', () => {
// console.log(`子应用${window.__MICRO_APP_NAME__}内部的window.addEventListener绑定`)
// }, false)


/* ---------------------- 定时器 --------------------- */
setInterval(() => {
console.log(`子应用${window.__MICRO_APP_NAME__}的setInterval`)
}, 5000)
// setInterval(() => {
// console.log(`子应用${window.__MICRO_APP_NAME__}的setInterval`)
// }, 5000)

setTimeout(() => {
console.log(`子应用${window.__MICRO_APP_NAME__}的setTimeout`)
}, 5000);
// setTimeout(() => {
// console.log(`子应用${window.__MICRO_APP_NAME__}的setTimeout`)
// }, 5000);


/* ---------------------- 创建元素 --------------------- */
Expand Down
12 changes: 6 additions & 6 deletions dev/children/react16/src/pages/page2/page2.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import bigImg from '../../assets/big-img.jpeg';
// 测试umd二次渲染时全局变量是否丢失
window.umdGlobalKey = 'umdGlobalKey'

window.addEventListener('click', () => {
console.log('测试umd懒加载页面二次渲染全局事件 - window.click')
})
// window.addEventListener('click', () => {
// console.log('测试umd懒加载页面二次渲染全局事件 - window.click')
// })

document.addEventListener('click', () => {
console.log('测试umd懒加载页面二次渲染全局事件 - document.click')
})
// document.addEventListener('click', () => {
// console.log('测试umd懒加载页面二次渲染全局事件 - document.click')
// })

window.microApp?.addDataListener((data) => {
console.log('懒加载的数据监听', data)
Expand Down
2 changes: 1 addition & 1 deletion dev/children/react17/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React from 'react'
// import { Button, Drawer } from 'antd';
import logo from './logo.svg';
import './App.css';
Expand Down
61 changes: 60 additions & 1 deletion dev/children/vite2/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,64 @@
// Generated by unplugin-auto-import
export {}
declare global {

const EffectScope: typeof import('vue')['EffectScope']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useDialog: typeof import('naive-ui')['useDialog']
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
const useMessage: typeof import('naive-ui')['useMessage']
const useNotification: typeof import('naive-ui')['useNotification']
const useSlots: typeof import('vue')['useSlots']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
}
2 changes: 2 additions & 0 deletions dev/children/vite2/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ declare module '@vue/runtime-core' {
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NPopover: typeof import('naive-ui')['NPopover']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
Expand Down
1 change: 1 addition & 0 deletions dev/children/vite2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"ant-design-vue": "^3.2.15",
"element-plus": "^2.3.0",
"naive-ui": "^2.34.3",
"vue": "^3.1.4",
"vue-router": "^4.0.10"
},
Expand Down
14 changes: 13 additions & 1 deletion dev/children/vite2/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import vue from '@vitejs/plugin-vue'
// import legacy from '@vitejs/plugin-legacy'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver, AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
import { ElementPlusResolver, AntDesignVueResolver, NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import ElementPlus from 'unplugin-element-plus/vite'

// https://vitejs.dev/config/
Expand All @@ -18,11 +18,23 @@ export default defineConfig({
ElementPlusResolver(),
// AntDesignVueResolver(), // need it?
],
imports: [
'vue',
{
'naive-ui': [
'useDialog',
'useMessage',
'useNotification',
'useLoadingBar'
]
}
]
}),
Components({
resolvers: [
ElementPlusResolver(),
AntDesignVueResolver(),
NaiveUiResolver(),
],
}),
ElementPlus()
Expand Down
Loading

0 comments on commit bab8c07

Please sign in to comment.