@vue/compiler-sfc 2.7.3 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.js +7 -6
- package/package.json +1 -1
package/dist/compiler-sfc.js
CHANGED
|
@@ -646,7 +646,6 @@ const DEFAULT_FILENAME = 'anonymous.vue';
|
|
|
646
646
|
const splitRE$1 = /\r?\n/g;
|
|
647
647
|
const replaceRE = /./g;
|
|
648
648
|
const isSpecialTag = makeMap('script,style,template', true);
|
|
649
|
-
const isNeedIndentLang = makeMap('pug,jade');
|
|
650
649
|
/**
|
|
651
650
|
* Parse a single-file component (*.vue) file into an SFC Descriptor Object.
|
|
652
651
|
*/
|
|
@@ -741,9 +740,11 @@ function parseComponent(source, options = {}) {
|
|
|
741
740
|
if (depth === 1 && currentBlock) {
|
|
742
741
|
currentBlock.end = start;
|
|
743
742
|
let text = source.slice(currentBlock.start, currentBlock.end);
|
|
744
|
-
if (options.deindent ||
|
|
745
|
-
//
|
|
746
|
-
(
|
|
743
|
+
if (options.deindent === true ||
|
|
744
|
+
// by default, deindent unless it's script with default lang or ts
|
|
745
|
+
(options.deindent !== false &&
|
|
746
|
+
!(currentBlock.type === 'script' &&
|
|
747
|
+
(!currentBlock.lang || currentBlock.lang === 'ts')))) {
|
|
747
748
|
text = deIndent(text);
|
|
748
749
|
}
|
|
749
750
|
// pad content so that linters and pre-processors can output correct
|
|
@@ -4362,7 +4363,7 @@ function renderStatic(index, isInFor) {
|
|
|
4362
4363
|
return tree;
|
|
4363
4364
|
}
|
|
4364
4365
|
// otherwise, render a fresh tree.
|
|
4365
|
-
tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy,
|
|
4366
|
+
tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
|
|
4366
4367
|
);
|
|
4367
4368
|
markStatic$1(tree, `__static__${index}`, false);
|
|
4368
4369
|
return tree;
|
|
@@ -5369,7 +5370,7 @@ function set(target, key, val) {
|
|
|
5369
5370
|
target.length = Math.max(target.length, key);
|
|
5370
5371
|
target.splice(key, 1, val);
|
|
5371
5372
|
// when mocking for SSR, array methods are not hijacked
|
|
5372
|
-
if (!ob.shallow && ob.mock) {
|
|
5373
|
+
if (ob && !ob.shallow && ob.mock) {
|
|
5373
5374
|
observe(val, false, true);
|
|
5374
5375
|
}
|
|
5375
5376
|
return val;
|