mirror of https://github.com/vuejs/core.git
fix: import
This commit is contained in:
parent
2f5f76779c
commit
b5eb4e78b8
|
@ -5,9 +5,9 @@ import {
|
||||||
AttributeNode,
|
AttributeNode,
|
||||||
SourceLocation,
|
SourceLocation,
|
||||||
NodeTypes,
|
NodeTypes,
|
||||||
InterpolationNode
|
InterpolationNode,
|
||||||
|
TransformOptions
|
||||||
} from '@vue/compiler-dom'
|
} from '@vue/compiler-dom'
|
||||||
import { TransformOptions } from 'vite'
|
|
||||||
|
|
||||||
export const enum IRNodeTypes {
|
export const enum IRNodeTypes {
|
||||||
ROOT,
|
ROOT,
|
||||||
|
@ -53,13 +53,13 @@ export function transform(
|
||||||
|
|
||||||
function transformChildren(children: TemplateChildNode[]) {
|
function transformChildren(children: TemplateChildNode[]) {
|
||||||
let template: string = ''
|
let template: string = ''
|
||||||
children.forEach((child, i) => walkNode(child, children.length > i + 1))
|
children.forEach((child, i) => walkNode(child))
|
||||||
return template
|
return template
|
||||||
|
|
||||||
function walkNode(node: TemplateChildNode, hasSibling: boolean) {
|
function walkNode(node: TemplateChildNode) {
|
||||||
switch (node.type) {
|
switch (node.type) {
|
||||||
case 1 satisfies NodeTypes.ELEMENT: {
|
case 1 satisfies NodeTypes.ELEMENT: {
|
||||||
template += transformElement(node, hasSibling)
|
template += transformElement(node)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case 2 satisfies NodeTypes.TEXT:
|
case 2 satisfies NodeTypes.TEXT:
|
||||||
|
@ -88,7 +88,7 @@ function transformInterpolation(node: InterpolationNode) {
|
||||||
// return `{{${node.content.content}}}`
|
// return `{{${node.content.content}}}`
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformElement(node: ElementNode, hasSibling: boolean) {
|
function transformElement(node: ElementNode) {
|
||||||
const { tag, props, children } = node
|
const { tag, props, children } = node
|
||||||
let template = `<${tag}`
|
let template = `<${tag}`
|
||||||
const propsTemplate = props
|
const propsTemplate = props
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { render } from 'vue/vapor'
|
import { render } from 'vue/vapor'
|
||||||
// @ts-expect-error
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
render(App.render, '#app')
|
render(App.render, '#app')
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"packages/*/__tests__",
|
"packages/*/__tests__",
|
||||||
"packages/dts-test",
|
"packages/dts-test",
|
||||||
"packages/vue/jsx-runtime",
|
"packages/vue/jsx-runtime",
|
||||||
"scripts/setupVitest.ts"
|
"scripts/setupVitest.ts",
|
||||||
|
"playground"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue