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
|
||||
// it to camelCase. See issue #2249
|
||||
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
|
||||
: `on:${rawName}`
|
||||
`on:${rawName}`
|
||||
eventName = createSimpleExpression(eventString, true, arg.loc)
|
||||
} else {
|
||||
// #2388
|
||||
|
|
|
@ -206,7 +206,10 @@ describe('compiler sfc: rewriteDefault', () => {
|
|||
|
||||
test('@Component\nexport default class w/ comments', async () => {
|
||||
expect(
|
||||
rewriteDefault(`// export default\n@Component\nexport default class Foo {}`, 'script')
|
||||
rewriteDefault(
|
||||
`// export default\n@Component\nexport default class Foo {}`,
|
||||
'script'
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
"// export default
|
||||
@Component
|
||||
|
@ -231,7 +234,8 @@ describe('compiler sfc: rewriteDefault', () => {
|
|||
test('@Component\nexport default class w/ comments 3', async () => {
|
||||
expect(
|
||||
rewriteDefault(
|
||||
`/*\n@Component\nexport default class Foo {}*/\n` + `export default class Bar {}`,
|
||||
`/*\n@Component\nexport default class Foo {}*/\n` +
|
||||
`export default class Bar {}`,
|
||||
'script'
|
||||
)
|
||||
).toMatchInlineSnapshot(`
|
||||
|
|
|
@ -49,8 +49,7 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
|
|||
createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`])
|
||||
)
|
||||
Array.from(cssContext.helpers.keys()).forEach(helper => {
|
||||
if (!ast.helpers.includes(helper))
|
||||
ast.helpers.push(helper)
|
||||
if (!ast.helpers.includes(helper)) ast.helpers.push(helper)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ export function ssrTransformTransitionGroup(
|
|||
node,
|
||||
context,
|
||||
otherProps,
|
||||
true, /* isComponent */
|
||||
false, /* isDynamicComponent */
|
||||
true /* isComponent */,
|
||||
false /* isDynamicComponent */,
|
||||
true /* ssr (skip event listeners) */
|
||||
)
|
||||
let propsExp = null
|
||||
|
|
|
@ -1048,7 +1048,6 @@ describe('api: options', () => {
|
|||
expect(root.innerHTML).toBe(`<h1>Foo</h1>`)
|
||||
})
|
||||
|
||||
|
||||
test('options defined in component have higher priority', async () => {
|
||||
const Mixin = {
|
||||
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> =>
|
||||
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 =>
|
||||
typeof val === 'function'
|
||||
export const isString = (val: unknown): val is string => typeof val === 'string'
|
||||
|
|
Loading…
Reference in New Issue