chore(vue): add eslint and prettier (#26635)

This commit is contained in:
Liam DeBeasi
2023-01-18 18:29:25 -05:00
committed by GitHub
parent 6d4c52aa5b
commit dc27736bd5
25 changed files with 5693 additions and 574 deletions

View File

@ -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);
}
}
};