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