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