diff --git a/main.uts b/main.uts index 0ee20ce49271a0fe5ce1d7f7d712dd55c169c4c1..194fccdb1ebb51134940ea7f03c18ad47399cb20 100644 --- a/main.uts +++ b/main.uts @@ -9,13 +9,11 @@ import GlobalChildMixinComp2 from '@/pages/composition/mixins/components/GlobalC import MixinCompForGlobalMixin from '@/pages/composition/mixins/components/MixinCompForGlobalMixin.uvue' import MixinCompForGlobalChildMixin from '@/pages/composition/mixins/components/MixinCompForGlobalChildMixin.uvue' -// #ifdef APP-ANDROID import plugin1 from '@/plugins/plugin1.uts' import plugin2 from '@/plugins/plugin2.uts' import plugin3 from '@/plugins/plugin3.uts' import plugin4 from '@/plugins/plugin4.uts' import CompForPlugin from '@/components/CompForPlugin.uvue' -// #endif export function createApp() { const app = createSSRApp(App) @@ -266,7 +264,6 @@ export function createApp() { app.mixin(globalMixin) // #endif - // #ifdef APP-ANDROID app.use(plugin1) app.use(plugin2) app.use(plugin3) @@ -274,7 +271,6 @@ export function createApp() { app.use(function (app: VueApp, componentName: string, componentInstance: CreateVueComponent) { app.component(componentName, componentInstance) }, 'CompForPlugin', CompForPlugin) - // #endif app.config.globalProperties.globalPropertiesStr = 'default string' app.config.globalProperties.globalPropertiesNum = 0 diff --git a/pages/app-instance/index/index.test.js b/pages/app-instance/index/index.test.js index c915dd7ab8fdf0ab4a558c463633fffd51853a46..7755c85e7f7de92622691eeef8fce95250f9162c 100644 --- a/pages/app-instance/index/index.test.js +++ b/pages/app-instance/index/index.test.js @@ -12,30 +12,28 @@ describe('app-instance', () => { expect(CompForAppComponentText).toBe('component for app.component') }) it('app.use', async () => { - if (process.env.uniTestPlatformInfo.startsWith('android')) { - const plugin1El = await page.$('.plugin1') - const plugin1Text = await plugin1El.text() - expect(plugin1Text).toBe('plugin1: 通过字面量方式创建的 plugin') + const plugin1El = await page.$('.plugin1') + const plugin1Text = await plugin1El.text() + expect(plugin1Text).toBe('plugin1: 通过字面量方式创建的 plugin') - const plugin2El = await page.$('.plugin2') - const plugin2Text = await plugin2El.text() - expect(plugin2Text).toBe('plugin2: 通过函数方式创建的 plugin') + const plugin2El = await page.$('.plugin2') + const plugin2Text = await plugin2El.text() + expect(plugin2Text).toBe('plugin2: 通过函数方式创建的 plugin') - const plugin3El = await page.$('.plugin3') - const plugin3Text = await plugin3El.text() - expect(plugin3Text).toBe( - 'plugin3: 通过 definePlugin + 对象字面量方式创建的 plugin' - ) + const plugin3El = await page.$('.plugin3') + const plugin3Text = await plugin3El.text() + expect(plugin3Text).toBe( + 'plugin3: 通过 definePlugin + 对象字面量方式创建的 plugin' + ) - const plugin4El = await page.$('.plugin4') - const plugin4Text = await plugin4El.text() - expect(plugin4Text).toBe( - 'plugin4: 通过 definePlugin + 函数方式创建的 plugin' - ) + const plugin4El = await page.$('.plugin4') + const plugin4Text = await plugin4El.text() + expect(plugin4Text).toBe( + 'plugin4: 通过 definePlugin + 函数方式创建的 plugin' + ) - const compForPluginEl = await page.$('.component-for-plugin') - const compForPluginText = await compForPluginEl.text() - expect(compForPluginText).toBe('component for plugin') - } + const compForPluginEl = await page.$('.component-for-plugin') + const compForPluginText = await compForPluginEl.text() + expect(compForPluginText).toBe('component for plugin') }) }) diff --git a/pages/app-instance/index/index.uvue b/pages/app-instance/index/index.uvue index d5073d57dba5119c5a7dc4d7da38ab7c54eaa126..362babb7fd15ea4bf130310c5f4fafe0b6ef85f0 100644 --- a/pages/app-instance/index/index.uvue +++ b/pages/app-instance/index/index.uvue @@ -1,25 +1,19 @@ -