feat: support delimiters option for runtime compilation

close #1679
This commit is contained in:
Evan You 2020-07-22 21:29:59 -04:00
parent 7edfdf7e23
commit ba17c871d8
3 changed files with 12 additions and 3 deletions

View File

@ -87,10 +87,15 @@ export function baseParse(
function createParserContext(
content: string,
options: ParserOptions
rawOptions: ParserOptions
): ParserContext {
const options = extend({}, defaultParserOptions)
for (const key in rawOptions) {
// @ts-ignore
options[key] = rawOptions[key] || defaultParserOptions[key]
}
return {
options: extend({}, defaultParserOptions, options),
options,
column: 1,
line: 1,
offset: 0,

View File

@ -607,7 +607,8 @@ function finishComponentSetup(
startMeasure(instance, `compile`)
}
Component.render = compile(Component.template, {
isCustomElement: instance.appContext.config.isCustomElement || NO
isCustomElement: instance.appContext.config.isCustomElement
// delimiters: Component.delimiters
})
if (__DEV__) {
endMeasure(instance, `compile`)

View File

@ -321,6 +321,9 @@ interface LegacyOptions<
renderTracked?: DebuggerHook
renderTriggered?: DebuggerHook
errorCaptured?: ErrorCapturedHook
// runtime compile only
delimiters?: [string, string]
}
export type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M'