]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat: support delimiters option for runtime compilation
authorEvan You <yyx990803@gmail.com>
Thu, 23 Jul 2020 01:29:59 +0000 (21:29 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 23 Jul 2020 18:27:17 +0000 (14:27 -0400)
close #1679

packages/compiler-core/src/parse.ts
packages/runtime-core/src/component.ts
packages/runtime-core/src/componentOptions.ts

index 5212480fc76d3df9b82b201103fd0f724d501d7c..e2888e32e6073ae4bdc7f0484be7129e5b3bd23e 100644 (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,
index bb1e8efdb4adc4adb8c48980b9dc5d4f1d1e127b..9efb657e9c599825e7078c0432611e9a45b2881e 100644 (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`)
index 65138e621a617a18c9ea2875bfb6151cc7c40246..948ceafc53835143f5e70cdf6f08f03f7cd1c78c 100644 (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'