From: 三咲智子 Kevin Deng Date: Thu, 30 Nov 2023 17:28:16 +0000 (+0800) Subject: style: format X-Git-Tag: v3.6.0-alpha.1~16^2~779 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=281d468020b85f44eb1fd82b37bf6c179734fd21;p=thirdparty%2Fvuejs%2Fcore.git style: format --- diff --git a/packages/runtime-vapor/.prettierrc b/packages/runtime-vapor/.prettierrc new file mode 100644 index 0000000000..e3b414c7e0 --- /dev/null +++ b/packages/runtime-vapor/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "all" +} diff --git a/packages/runtime-vapor/src/component.ts b/packages/runtime-vapor/src/component.ts index 02fc0d3ba0..05310689ed 100644 --- a/packages/runtime-vapor/src/component.ts +++ b/packages/runtime-vapor/src/component.ts @@ -16,7 +16,7 @@ export interface ComponentInternalInstance { let uid = 0 export const createComponentInstance = ( - component: BlockFn + component: BlockFn, ): ComponentInternalInstance => { const instance: ComponentInternalInstance = { uid: uid++, @@ -25,7 +25,7 @@ export const createComponentInstance = ( scope: new EffectScope(true /* detached */)!, component, - isMounted: false + isMounted: false, // TODO: registory of provides, appContext, lifecycles, ... } return instance diff --git a/packages/runtime-vapor/src/index.ts b/packages/runtime-vapor/src/index.ts index 0eebcbbf8b..7713703a76 100644 --- a/packages/runtime-vapor/src/index.ts +++ b/packages/runtime-vapor/src/index.ts @@ -33,7 +33,7 @@ export { effectScope, EffectScope, getCurrentScope, - onScopeDispose + onScopeDispose, } from '@vue/reactivity' export { effect } from './scheduler' export * from './on' diff --git a/packages/runtime-vapor/src/on.ts b/packages/runtime-vapor/src/on.ts index d4192b3540..742cb45c57 100644 --- a/packages/runtime-vapor/src/on.ts +++ b/packages/runtime-vapor/src/on.ts @@ -2,7 +2,7 @@ export function on( el: any, event: string, handler: () => any, - options?: EventListenerOptions + options?: EventListenerOptions, ) { el.addEventListener(event, handler, options) } diff --git a/packages/runtime-vapor/src/render.ts b/packages/runtime-vapor/src/render.ts index b5c5a72cd8..49c30e6e10 100644 --- a/packages/runtime-vapor/src/render.ts +++ b/packages/runtime-vapor/src/render.ts @@ -2,7 +2,7 @@ import { isArray, normalizeClass, normalizeStyle, - toDisplayString + toDisplayString, } from '@vue/shared' import { ComponentInternalInstance, createComponentInstance } from './component' @@ -14,7 +14,7 @@ export type BlockFn = (props?: any) => Block export function render( comp: BlockFn, - container: string | ParentNode + container: string | ParentNode, ): ComponentInternalInstance { const instance = createComponentInstance(comp) mountComponent(instance, (container = normalizeContainer(container))) @@ -29,11 +29,11 @@ export function normalizeContainer(container: string | ParentNode): ParentNode { export const mountComponent = ( instance: ComponentInternalInstance, - container: ParentNode + container: ParentNode, ) => { instance.container = container const block = instance.scope.run( - () => (instance.block = instance.component()) + () => (instance.block = instance.component()), )! insert(block, instance.container) instance.isMounted = true @@ -55,7 +55,7 @@ export const unmountComponent = (instance: ComponentInternalInstance) => { export function insert( block: Block, parent: ParentNode, - anchor: Node | null = null + anchor: Node | null = null, ) { // if (!isHydrating) { if (block instanceof Node) { @@ -151,7 +151,7 @@ export function setDynamicProp(el: Element, key: string, val: any) { type Children = Record export function children(n: ChildNode): Children { - return { ...Array.from(n.childNodes).map(n => [n, children(n)]) } + return { ...Array.from(n.childNodes).map((n) => [n, children(n)]) } } export function createTextNode(val: unknown): Text {