Browse Source

refactor: tidy

三咲智子 Kevin Deng 2 years ago
parent
commit
cd768d262f
2 changed files with 7 additions and 7 deletions
  1. 2 7
      packages/runtime-vapor/src/index.ts
  2. 5 0
      packages/runtime-vapor/src/render.ts

+ 2 - 7
packages/runtime-vapor/src/index.ts

@@ -1,8 +1,3 @@
-export { template } from './template'
-export * from './render'
 export * from './on'
-
-type Children = Record<number, [ChildNode, Children]>
-export function children(n: ChildNode): Children {
-  return { ...Array.from(n.childNodes).map(n => [n, children(n)]) }
-}
+export * from './render'
+export * from './template'

+ 5 - 0
packages/runtime-vapor/src/render.ts

@@ -112,3 +112,8 @@ export function setDynamicProp(el: Element, key: string, val: any) {
     setAttr(el, key, void 0, val)
   }
 }
+
+type Children = Record<number, [ChildNode, Children]>
+export function children(n: ChildNode): Children {
+  return { ...Array.from(n.childNodes).map(n => [n, children(n)]) }
+}