From: 三咲智子 Kevin Deng Date: Mon, 20 Nov 2023 06:16:36 +0000 (+0800) Subject: fix: import X-Git-Tag: v3.6.0-alpha.1~16^2~841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5eb4e78b8d253ddd35ed4479187e3161bbd4ac4;p=thirdparty%2Fvuejs%2Fcore.git fix: import --- diff --git a/packages/compiler-vapor/src/transform.ts b/packages/compiler-vapor/src/transform.ts index 5624b2de3f..56795bec50 100644 --- a/packages/compiler-vapor/src/transform.ts +++ b/packages/compiler-vapor/src/transform.ts @@ -5,9 +5,9 @@ import { AttributeNode, SourceLocation, NodeTypes, - InterpolationNode + InterpolationNode, + TransformOptions } from '@vue/compiler-dom' -import { TransformOptions } from 'vite' export const enum IRNodeTypes { ROOT, @@ -53,13 +53,13 @@ export function transform( function transformChildren(children: TemplateChildNode[]) { let template: string = '' - children.forEach((child, i) => walkNode(child, children.length > i + 1)) + children.forEach((child, i) => walkNode(child)) return template - function walkNode(node: TemplateChildNode, hasSibling: boolean) { + function walkNode(node: TemplateChildNode) { switch (node.type) { case 1 satisfies NodeTypes.ELEMENT: { - template += transformElement(node, hasSibling) + template += transformElement(node) break } case 2 satisfies NodeTypes.TEXT: @@ -88,7 +88,7 @@ function transformInterpolation(node: InterpolationNode) { // return `{{${node.content.content}}}` } -function transformElement(node: ElementNode, hasSibling: boolean) { +function transformElement(node: ElementNode) { const { tag, props, children } = node let template = `<${tag}` const propsTemplate = props diff --git a/playground/src/main.ts b/playground/src/main.ts index d81eb1ebbb..69485dcbe4 100644 --- a/playground/src/main.ts +++ b/playground/src/main.ts @@ -1,5 +1,5 @@ import { render } from 'vue/vapor' -// @ts-expect-error import App from './App.vue' +// @ts-expect-error render(App.render, '#app') diff --git a/tsconfig.json b/tsconfig.json index 5d7789b082..1864a3e8e0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,6 +34,7 @@ "packages/*/__tests__", "packages/dts-test", "packages/vue/jsx-runtime", - "scripts/setupVitest.ts" + "scripts/setupVitest.ts", + "playground" ] }