mirror of https://github.com/vuejs/core.git
chore: format
This commit is contained in:
parent
24f4c479d6
commit
534593cfa8
|
@ -54,9 +54,9 @@ export const transformOn: DirectiveTransform = (
|
||||||
? // for component and vnode lifecycle event listeners, auto convert
|
? // for component and vnode lifecycle event listeners, auto convert
|
||||||
// it to camelCase. See issue #2249
|
// it to camelCase. See issue #2249
|
||||||
toHandlerKey(camelize(rawName))
|
toHandlerKey(camelize(rawName))
|
||||||
// preserve case for plain element listeners that have uppercase
|
: // preserve case for plain element listeners that have uppercase
|
||||||
// letters, as these may be custom elements' custom events
|
// letters, as these may be custom elements' custom events
|
||||||
: `on:${rawName}`
|
`on:${rawName}`
|
||||||
eventName = createSimpleExpression(eventString, true, arg.loc)
|
eventName = createSimpleExpression(eventString, true, arg.loc)
|
||||||
} else {
|
} else {
|
||||||
// #2388
|
// #2388
|
||||||
|
|
|
@ -206,7 +206,10 @@ describe('compiler sfc: rewriteDefault', () => {
|
||||||
|
|
||||||
test('@Component\nexport default class w/ comments', async () => {
|
test('@Component\nexport default class w/ comments', async () => {
|
||||||
expect(
|
expect(
|
||||||
rewriteDefault(`// export default\n@Component\nexport default class Foo {}`, 'script')
|
rewriteDefault(
|
||||||
|
`// export default\n@Component\nexport default class Foo {}`,
|
||||||
|
'script'
|
||||||
|
)
|
||||||
).toMatchInlineSnapshot(`
|
).toMatchInlineSnapshot(`
|
||||||
"// export default
|
"// export default
|
||||||
@Component
|
@Component
|
||||||
|
@ -231,7 +234,8 @@ describe('compiler sfc: rewriteDefault', () => {
|
||||||
test('@Component\nexport default class w/ comments 3', async () => {
|
test('@Component\nexport default class w/ comments 3', async () => {
|
||||||
expect(
|
expect(
|
||||||
rewriteDefault(
|
rewriteDefault(
|
||||||
`/*\n@Component\nexport default class Foo {}*/\n` + `export default class Bar {}`,
|
`/*\n@Component\nexport default class Foo {}*/\n` +
|
||||||
|
`export default class Bar {}`,
|
||||||
'script'
|
'script'
|
||||||
)
|
)
|
||||||
).toMatchInlineSnapshot(`
|
).toMatchInlineSnapshot(`
|
||||||
|
|
|
@ -49,8 +49,7 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
|
||||||
createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
|
createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
|
||||||
)
|
)
|
||||||
Array.from(cssContext.helpers.keys()).forEach(helper => {
|
Array.from(cssContext.helpers.keys()).forEach(helper => {
|
||||||
if (!ast.helpers.includes(helper))
|
if (!ast.helpers.includes(helper)) ast.helpers.push(helper)
|
||||||
ast.helpers.push(helper)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ export function ssrTransformTransitionGroup(
|
||||||
node,
|
node,
|
||||||
context,
|
context,
|
||||||
otherProps,
|
otherProps,
|
||||||
true, /* isComponent */
|
true /* isComponent */,
|
||||||
false, /* isDynamicComponent */
|
false /* isDynamicComponent */,
|
||||||
true /* ssr (skip event listeners) */
|
true /* ssr (skip event listeners) */
|
||||||
)
|
)
|
||||||
let propsExp = null
|
let propsExp = null
|
||||||
|
|
|
@ -1048,7 +1048,6 @@ describe('api: options', () => {
|
||||||
expect(root.innerHTML).toBe(`<h1>Foo</h1>`)
|
expect(root.innerHTML).toBe(`<h1>Foo</h1>`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
test('options defined in component have higher priority', async () => {
|
test('options defined in component have higher priority', async () => {
|
||||||
const Mixin = {
|
const Mixin = {
|
||||||
msg1: 'base'
|
msg1: 'base'
|
||||||
|
|
|
@ -52,7 +52,8 @@ export const isMap = (val: unknown): val is Map<any, any> =>
|
||||||
export const isSet = (val: unknown): val is Set<any> =>
|
export const isSet = (val: unknown): val is Set<any> =>
|
||||||
toTypeString(val) === '[object Set]'
|
toTypeString(val) === '[object Set]'
|
||||||
|
|
||||||
export const isDate = (val: unknown): val is Date => toTypeString(val) === '[object Date]'
|
export const isDate = (val: unknown): val is Date =>
|
||||||
|
toTypeString(val) === '[object Date]'
|
||||||
export const isFunction = (val: unknown): val is Function =>
|
export const isFunction = (val: unknown): val is Function =>
|
||||||
typeof val === 'function'
|
typeof val === 'function'
|
||||||
export const isString = (val: unknown): val is string => typeof val === 'string'
|
export const isString = (val: unknown): val is string => typeof val === 'string'
|
||||||
|
|
Loading…
Reference in New Issue