Skip to content

Commit

Permalink
feat: support delimiters option for runtime compilation
Browse files Browse the repository at this point in the history
close #1679
  • Loading branch information
yyx990803 committed Jul 23, 2020
1 parent 7edfdf7 commit ba17c87
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/compiler-core/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,

This comment has been minimized.

Copy link
@meteorlxy

meteorlxy Aug 31, 2020

Member

What's this change for? 🤔

I can't figure out the purpose

column: 1,
line: 1,
offset: 0,
Expand Down
3 changes: 2 additions & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
3 changes: 3 additions & 0 deletions packages/runtime-core/src/componentOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ba17c87

Please sign in to comment.