]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: improve parser option comments [ci skip]
authorEvan You <yyx990803@gmail.com>
Tue, 24 Mar 2020 22:29:15 +0000 (18:29 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 24 Mar 2020 22:29:15 +0000 (18:29 -0400)
packages/compiler-core/src/options.ts

index 68a8e3282abc910d6d5f125f81828b611f7c49b7..9bd8950bed4a1ad772ec97f664fe3de96e6f9670 100644 (file)
@@ -9,11 +9,16 @@ import {
 import { ParserPlugin } from '@babel/parser'
 
 export interface ParserOptions {
-  isVoidTag?: (tag: string) => boolean // e.g. img, br, hr
-  isNativeTag?: (tag: string) => boolean // e.g. loading-indicator in weex
-  isPreTag?: (tag: string) => boolean // e.g. <pre> where whitespace is intact
-  isCustomElement?: (tag: string) => boolean
+  // e.g. platform native elements, e.g. <div> for browsers
+  isNativeTag?: (tag: string) => boolean
+  // e.g. native elements that can self-close, e.g. <img>, <br>, <hr>
+  isVoidTag?: (tag: string) => boolean
+  // e.g. elements that should preserve whitespace inside, e.g. <pre>
+  isPreTag?: (tag: string) => boolean
+  // platform-specific built-in components e.g. <Transition>
   isBuiltInComponent?: (tag: string) => symbol | void
+  // separate option for end users to extend the native elements list
+  isCustomElement?: (tag: string) => boolean
   getNamespace?: (tag: string, parent: ElementNode | undefined) => Namespace
   getTextMode?: (
     tag: string,