wip(ssr): v-bind basic usage
This commit is contained in:
@@ -28,7 +28,8 @@ export const enum DOMErrorCodes {
|
||||
X_V_MODEL_ON_INVALID_ELEMENT,
|
||||
X_V_MODEL_ARG_ON_ELEMENT,
|
||||
X_V_MODEL_ON_FILE_INPUT_ELEMENT,
|
||||
X_V_SHOW_NO_EXPRESSION
|
||||
X_V_SHOW_NO_EXPRESSION,
|
||||
__EXTEND_POINT__
|
||||
}
|
||||
|
||||
export const DOMErrorMessages: { [code: number]: string } = {
|
||||
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
CodegenResult,
|
||||
isBuiltInType,
|
||||
ParserOptions,
|
||||
RootNode
|
||||
RootNode,
|
||||
noopDirectiveTransform
|
||||
} from '@vue/compiler-core'
|
||||
import { parserOptionsMinimal } from './parserOptionsMinimal'
|
||||
import { parserOptionsStandard } from './parserOptionsStandard'
|
||||
import { transformStyle } from './transforms/transformStyle'
|
||||
import { transformCloak } from './transforms/vCloak'
|
||||
import { transformVHtml } from './transforms/vHtml'
|
||||
import { transformVText } from './transforms/vText'
|
||||
import { transformModel } from './transforms/vModel'
|
||||
@@ -31,7 +31,7 @@ export function compile(
|
||||
...options,
|
||||
nodeTransforms: [transformStyle, ...(options.nodeTransforms || [])],
|
||||
directiveTransforms: {
|
||||
cloak: transformCloak,
|
||||
cloak: noopDirectiveTransform,
|
||||
html: transformVHtml,
|
||||
text: transformVText,
|
||||
model: transformModel, // override compiler-core
|
||||
@@ -56,4 +56,5 @@ export function parse(template: string, options: ParserOptions = {}): RootNode {
|
||||
})
|
||||
}
|
||||
|
||||
export { DOMErrorCodes } from './errors'
|
||||
export * from '@vue/compiler-core'
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { DirectiveTransform } from '@vue/compiler-core'
|
||||
|
||||
export const transformCloak: DirectiveTransform = () => {
|
||||
return { props: [], needRuntime: false }
|
||||
}
|
||||
@@ -24,7 +24,6 @@ export const transformVHtml: DirectiveTransform = (dir, node, context) => {
|
||||
createSimpleExpression(`innerHTML`, true, loc),
|
||||
exp || createSimpleExpression('', true)
|
||||
)
|
||||
],
|
||||
needRuntime: false
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,8 +102,7 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
|
||||
}
|
||||
|
||||
return {
|
||||
props: [createObjectProperty(key, handlerExp)],
|
||||
needRuntime: false
|
||||
props: [createObjectProperty(key, handlerExp)]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ export const transformVText: DirectiveTransform = (dir, node, context) => {
|
||||
createSimpleExpression(`textContent`, true, loc),
|
||||
exp || createSimpleExpression('', true)
|
||||
)
|
||||
],
|
||||
needRuntime: false
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user