chore: run prettier
This commit is contained in:
parent
d45e47569d
commit
1068212cb2
@ -78,7 +78,7 @@ describe('compiler: v-if', () => {
|
|||||||
expect(node.branches[0].children[2].type).toBe(NodeTypes.ELEMENT)
|
expect(node.branches[0].children[2].type).toBe(NodeTypes.ELEMENT)
|
||||||
expect((node.branches[0].children[2] as ElementNode).tag).toBe(`p`)
|
expect((node.branches[0].children[2] as ElementNode).tag).toBe(`p`)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('component v-if', () => {
|
test('component v-if', () => {
|
||||||
const { node } = parseWithIfTransform(`<Component v-if="ok"></Component>`)
|
const { node } = parseWithIfTransform(`<Component v-if="ok"></Component>`)
|
||||||
expect(node.type).toBe(NodeTypes.IF)
|
expect(node.type).toBe(NodeTypes.IF)
|
||||||
|
@ -48,6 +48,10 @@ export {
|
|||||||
trackVForSlotScopes,
|
trackVForSlotScopes,
|
||||||
trackSlotScopes
|
trackSlotScopes
|
||||||
} from './transforms/vSlot'
|
} from './transforms/vSlot'
|
||||||
export { transformElement, resolveComponentType, buildProps } from './transforms/transformElement'
|
export {
|
||||||
|
transformElement,
|
||||||
|
resolveComponentType,
|
||||||
|
buildProps
|
||||||
|
} from './transforms/transformElement'
|
||||||
export { processSlotOutlet } from './transforms/transformSlotOutlet'
|
export { processSlotOutlet } from './transforms/transformSlotOutlet'
|
||||||
export { generateCodeFrame } from '@vue/shared'
|
export { generateCodeFrame } from '@vue/shared'
|
||||||
|
72
packages/runtime-dom/jsx.d.ts
vendored
72
packages/runtime-dom/jsx.d.ts
vendored
@ -79,7 +79,15 @@ interface AriaAttributes {
|
|||||||
*/
|
*/
|
||||||
'aria-controls'?: string
|
'aria-controls'?: string
|
||||||
/** Indicates the element that represents the current item within a container or set of related elements. */
|
/** Indicates the element that represents the current item within a container or set of related elements. */
|
||||||
'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time'
|
'aria-current'?:
|
||||||
|
| boolean
|
||||||
|
| 'false'
|
||||||
|
| 'true'
|
||||||
|
| 'page'
|
||||||
|
| 'step'
|
||||||
|
| 'location'
|
||||||
|
| 'date'
|
||||||
|
| 'time'
|
||||||
/**
|
/**
|
||||||
* Identifies the element (or elements) that describes the object.
|
* Identifies the element (or elements) that describes the object.
|
||||||
* @see aria-labelledby
|
* @see aria-labelledby
|
||||||
@ -118,7 +126,15 @@ interface AriaAttributes {
|
|||||||
*/
|
*/
|
||||||
'aria-grabbed'?: boolean | 'false' | 'true'
|
'aria-grabbed'?: boolean | 'false' | 'true'
|
||||||
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
|
/** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */
|
||||||
'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'
|
'aria-haspopup'?:
|
||||||
|
| boolean
|
||||||
|
| 'false'
|
||||||
|
| 'true'
|
||||||
|
| 'menu'
|
||||||
|
| 'listbox'
|
||||||
|
| 'tree'
|
||||||
|
| 'grid'
|
||||||
|
| 'dialog'
|
||||||
/**
|
/**
|
||||||
* Indicates whether the element is exposed to an accessibility API.
|
* Indicates whether the element is exposed to an accessibility API.
|
||||||
* @see aria-disabled.
|
* @see aria-disabled.
|
||||||
@ -228,16 +244,15 @@ interface AriaAttributes {
|
|||||||
'aria-valuetext'?: string
|
'aria-valuetext'?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HTMLAttributes extends AriaAttributes{
|
export interface HTMLAttributes extends AriaAttributes {
|
||||||
|
domPropsInnerHTML?: string
|
||||||
domPropsInnerHTML?: string;
|
|
||||||
|
|
||||||
class?: any
|
class?: any
|
||||||
style?: string | CSSProperties
|
style?: string | CSSProperties
|
||||||
|
|
||||||
// Standard HTML Attributes
|
// Standard HTML Attributes
|
||||||
accesskey?: string
|
accesskey?: string
|
||||||
contenteditable?: Booleanish | "inherit"
|
contenteditable?: Booleanish | 'inherit'
|
||||||
contextmenu?: string
|
contextmenu?: string
|
||||||
dir?: string
|
dir?: string
|
||||||
draggable?: Booleanish
|
draggable?: Booleanish
|
||||||
@ -285,7 +300,15 @@ export interface HTMLAttributes extends AriaAttributes{
|
|||||||
* Hints at the type of data that might be entered by the user while editing the element or its contents
|
* Hints at the type of data that might be entered by the user while editing the element or its contents
|
||||||
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
|
* @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
|
||||||
*/
|
*/
|
||||||
inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'
|
inputmode?:
|
||||||
|
| 'none'
|
||||||
|
| 'text'
|
||||||
|
| 'tel'
|
||||||
|
| 'url'
|
||||||
|
| 'email'
|
||||||
|
| 'numeric'
|
||||||
|
| 'decimal'
|
||||||
|
| 'search'
|
||||||
/**
|
/**
|
||||||
* Specify that a standard HTML element should behave like a defined custom built-in element
|
* Specify that a standard HTML element should behave like a defined custom built-in element
|
||||||
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
|
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
|
||||||
@ -317,8 +340,7 @@ export interface AreaHTMLAttributes extends HTMLAttributes {
|
|||||||
target?: string
|
target?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AudioHTMLAttributes extends MediaHTMLAttributes {
|
export interface AudioHTMLAttributes extends MediaHTMLAttributes {}
|
||||||
}
|
|
||||||
|
|
||||||
export interface BaseHTMLAttributes extends HTMLAttributes {
|
export interface BaseHTMLAttributes extends HTMLAttributes {
|
||||||
href?: string
|
href?: string
|
||||||
@ -712,8 +734,7 @@ export interface WebViewHTMLAttributes extends HTMLAttributes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SVGAttributes extends AriaAttributes {
|
export interface SVGAttributes extends AriaAttributes {
|
||||||
|
domPropsInnerHTML?: string
|
||||||
domPropsInnerHTML?: string;
|
|
||||||
|
|
||||||
color?: string
|
color?: string
|
||||||
height?: number | string
|
height?: number | string
|
||||||
@ -736,7 +757,20 @@ export interface SVGAttributes extends AriaAttributes {
|
|||||||
'accent-height'?: number | string
|
'accent-height'?: number | string
|
||||||
accumulate?: 'none' | 'sum'
|
accumulate?: 'none' | 'sum'
|
||||||
additive?: 'replace' | 'sum'
|
additive?: 'replace' | 'sum'
|
||||||
'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'
|
'alignment-baseline'?:
|
||||||
|
| 'auto'
|
||||||
|
| 'baseline'
|
||||||
|
| 'before-edge'
|
||||||
|
| 'text-before-edge'
|
||||||
|
| 'middle'
|
||||||
|
| 'central'
|
||||||
|
| 'after-edge'
|
||||||
|
| 'text-after-edge'
|
||||||
|
| 'ideographic'
|
||||||
|
| 'alphabetic'
|
||||||
|
| 'hanging'
|
||||||
|
| 'mathematical'
|
||||||
|
| 'inherit'
|
||||||
allowReorder?: 'no' | 'yes'
|
allowReorder?: 'no' | 'yes'
|
||||||
alphabetic?: number | string
|
alphabetic?: number | string
|
||||||
amplitude?: number | string
|
amplitude?: number | string
|
||||||
@ -955,13 +989,13 @@ export interface SVGAttributes extends AriaAttributes {
|
|||||||
x?: number | string
|
x?: number | string
|
||||||
xChannelSelector?: string
|
xChannelSelector?: string
|
||||||
'x-height'?: number | string
|
'x-height'?: number | string
|
||||||
'xlinkActuate'?: string
|
xlinkActuate?: string
|
||||||
'xlinkArcrole'?: string
|
xlinkArcrole?: string
|
||||||
'xlinkHref'?: string
|
xlinkHref?: string
|
||||||
'xlinkRole'?: string
|
xlinkRole?: string
|
||||||
'xlinkShow'?: string
|
xlinkShow?: string
|
||||||
'xlinkTitle'?: string
|
xlinkTitle?: string
|
||||||
'xlinkType'?: string
|
xlinkType?: string
|
||||||
y1?: number | string
|
y1?: number | string
|
||||||
y2?: number | string
|
y2?: number | string
|
||||||
y?: number | string
|
y?: number | string
|
||||||
|
@ -53,9 +53,7 @@ export function ssrRenderDynamicAttr(
|
|||||||
if (isBooleanAttr(attrKey)) {
|
if (isBooleanAttr(attrKey)) {
|
||||||
return value === false ? `` : ` ${attrKey}`
|
return value === false ? `` : ` ${attrKey}`
|
||||||
} else if (isSSRSafeAttrName(attrKey)) {
|
} else if (isSSRSafeAttrName(attrKey)) {
|
||||||
return value === ''
|
return value === '' ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`
|
||||||
? ` ${attrKey}`
|
|
||||||
: ` ${attrKey}="${escapeHtml(value)}"`
|
|
||||||
} else {
|
} else {
|
||||||
console.warn(
|
console.warn(
|
||||||
`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
|
`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user