mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00
feat(vue): add custom elements bundle (#23458)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Ref, ComponentPublicInstance } from 'vue';
|
||||
import { Config as CoreConfig, LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from '@ionic/core';
|
||||
import { Config as CoreConfig, LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from '@ionic/core/components';
|
||||
|
||||
type LIFECYCLE_EVENTS = typeof LIFECYCLE_WILL_ENTER | typeof LIFECYCLE_DID_ENTER | typeof LIFECYCLE_WILL_LEAVE | typeof LIFECYCLE_DID_LEAVE;
|
||||
|
||||
@ -57,3 +57,11 @@ export const getConfig = (): CoreConfig | null => {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export const defineCustomElement = (tagName: string, customElement: any) => {
|
||||
if (typeof customElements === 'undefined') return;
|
||||
|
||||
if (!customElements.get(tagName)) {
|
||||
customElements.define(tagName, customElement);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user