mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
chore(vue): add eslint and prettier (#26635)
This commit is contained in:
@ -1,18 +1,19 @@
|
||||
import { h, defineComponent, shallowRef, VNode } from 'vue';
|
||||
import { defineCustomElement } from '@ionic/core/components/ion-app.js';
|
||||
import { defineCustomElement } from "@ionic/core/components/ion-app.js";
|
||||
import type { VNode } from "vue";
|
||||
import { h, defineComponent, shallowRef } from "vue";
|
||||
|
||||
const userComponents = shallowRef([]);
|
||||
export const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
||||
defineCustomElement();
|
||||
return () => {
|
||||
return h(
|
||||
'ion-app',
|
||||
"ion-app",
|
||||
{
|
||||
...attrs
|
||||
...attrs,
|
||||
},
|
||||
[slots.default && slots.default(), ...userComponents.value]
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
@ -26,11 +27,8 @@ export const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
||||
* of `ion-app` within the current application context.
|
||||
*/
|
||||
export const addTeleportedUserComponent = (component: VNode) => {
|
||||
userComponents.value = [
|
||||
...userComponents.value,
|
||||
component
|
||||
]
|
||||
}
|
||||
userComponents.value = [...userComponents.value, component];
|
||||
};
|
||||
|
||||
export const removeTeleportedUserComponent = (component: VNode) => {
|
||||
/**
|
||||
@ -39,8 +37,8 @@ export const removeTeleportedUserComponent = (component: VNode) => {
|
||||
* but this was causing a bug where dismissing an overlay and then presenting
|
||||
* a new overlay, would cause the new overlay to be removed.
|
||||
*/
|
||||
const index = userComponents.value.findIndex(cmp => cmp === component);
|
||||
const index = userComponents.value.findIndex((cmp) => cmp === component);
|
||||
if (index !== -1) {
|
||||
userComponents.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user