mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-03-13 14:14:40 +08:00
feat: add isGlobalElement option
This commit is contained in:
parent
1d6003c043
commit
041d15cff2
@ -20,6 +20,8 @@ export interface VueJSXPluginOptions {
|
|||||||
mergeProps?: boolean;
|
mergeProps?: boolean;
|
||||||
/** configuring custom elements */
|
/** configuring custom elements */
|
||||||
isCustomElement?: (tag: string) => boolean;
|
isCustomElement?: (tag: string) => boolean;
|
||||||
|
/** configuring global elements */
|
||||||
|
isGlobalElement?: (tag: string) => boolean;
|
||||||
/** enable object slots syntax */
|
/** enable object slots syntax */
|
||||||
enableObjectSlots?: boolean;
|
enableObjectSlots?: boolean;
|
||||||
/** Replace the function used when compiling JSX expressions */
|
/** Replace the function used when compiling JSX expressions */
|
||||||
|
@ -109,6 +109,8 @@ export const getTag = (
|
|||||||
? t.identifier(name)
|
? t.identifier(name)
|
||||||
: state.opts.isCustomElement?.(name)
|
: state.opts.isCustomElement?.(name)
|
||||||
? t.stringLiteral(name)
|
? t.stringLiteral(name)
|
||||||
|
: state.opts.isGlobalElement?.(name)
|
||||||
|
? t.identifier(name)
|
||||||
: t.callExpression(createIdentifier(state, 'resolveComponent'), [
|
: t.callExpression(createIdentifier(state, 'resolveComponent'), [
|
||||||
t.stringLiteral(name),
|
t.stringLiteral(name),
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user