From c4235b46b8a4664191c45c59c2881797f29910a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E8=83=9C?= Date: Mon, 21 Jan 2019 22:34:20 +0800 Subject: [PATCH] add compiler options feat --- lib/template-compiler.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/template-compiler.js b/lib/template-compiler.js index 7981216..ed171b4 100644 --- a/lib/template-compiler.js +++ b/lib/template-compiler.js @@ -68,9 +68,14 @@ module.exports = function (html) { // var compiled = compiler.compile(html, Object.assign({ // preserveWhitespace: vueOptions.preserveWhitespace // }, defaultCompileOptions)) - var compiled = compiler.compile(html, { - recyclable: query.recyclable - }) + + var options = {recyclable: query.recyclable} + if (vueOptions) { + if (vueOptions.compilerOptions) { + Object.assign(options, vueOptions.compilerOptions) + } + } + var compiled = compiler.compile(html, options) var code if (compiled.errors.length) { var self = this