mirror of
				https://github.com/vuejs/babel-plugin-jsx.git
				synced 2025-11-04 19:32:18 +08:00 
			
		
		
		
	feat: add isGlobalElement option
This commit is contained in:
		@@ -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),
 | 
			
		||||
              ]);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user