]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
style: format
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 30 Nov 2023 17:28:16 +0000 (01:28 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 30 Nov 2023 17:28:16 +0000 (01:28 +0800)
packages/runtime-vapor/.prettierrc [new file with mode: 0644]
packages/runtime-vapor/src/component.ts
packages/runtime-vapor/src/index.ts
packages/runtime-vapor/src/on.ts
packages/runtime-vapor/src/render.ts

diff --git a/packages/runtime-vapor/.prettierrc b/packages/runtime-vapor/.prettierrc
new file mode 100644 (file)
index 0000000..e3b414c
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "semi": false,
+  "singleQuote": true,
+  "trailingComma": "all"
+}
index 02fc0d3ba0f107922fcc57419d3f751db36c0d9e..05310689eda163463114c6d562e5b895120df26b 100644 (file)
@@ -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
index 0eebcbbf8bdb32425e8d4c0f8a856fe12ca74972..7713703a76dc5597e0b78127724bdb9c35879032 100644 (file)
@@ -33,7 +33,7 @@ export {
   effectScope,
   EffectScope,
   getCurrentScope,
-  onScopeDispose
+  onScopeDispose,
 } from '@vue/reactivity'
 export { effect } from './scheduler'
 export * from './on'
index d4192b35405d69eed55dbf765112073b6b90fef7..742cb45c5766758b93123b97c638eb5d40e14e1c 100644 (file)
@@ -2,7 +2,7 @@ export function on(
   el: any,
   event: string,
   handler: () => any,
-  options?: EventListenerOptions
+  options?: EventListenerOptions,
 ) {
   el.addEventListener(event, handler, options)
 }
index b5c5a72cd8d60ee691490ddbff2984c85764a7b8..49c30e6e10594d66aa02dd5f52a713036a02c07f 100644 (file)
@@ -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<number, [ChildNode, Children]>
 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 {