提交 0aff5211 编写于 作者: fxy060608's avatar fxy060608

update weex-template-compiler

上级 c1161501
...@@ -555,6 +555,7 @@ function parseHTML (html, options) { ...@@ -555,6 +555,7 @@ function parseHTML (html, options) {
var splitRE = /\r?\n/g; var splitRE = /\r?\n/g;
var replaceRE = /./g; var replaceRE = /./g;
var isSpecialTag = makeMap('script,style,template', true); var isSpecialTag = makeMap('script,style,template', true);
var isCustomBlock = makeMap('wxs,filter,sjs', true);// fixed by xxxxxx
/** /**
* Parse a single-file component (*.vue) file into an SFC Descriptor Object. * Parse a single-file component (*.vue) file into an SFC Descriptor Object.
...@@ -611,8 +612,8 @@ function parseComponent ( ...@@ -611,8 +612,8 @@ function parseComponent (
cumulated[name] = value || true; cumulated[name] = value || true;
return cumulated return cumulated
}, {}) }, {})
}; };// fixed by xxxxxx
if (isSpecialTag(tag)) { if (isSpecialTag(tag) && !isCustomBlock(currentBlock.attrs.lang || '')) {
checkAttrs(currentBlock, attrs); checkAttrs(currentBlock, attrs);
if (tag === 'style') { if (tag === 'style') {
sfc.styles.push(currentBlock); sfc.styles.push(currentBlock);
...@@ -669,7 +670,8 @@ function parseComponent ( ...@@ -669,7 +670,8 @@ function parseComponent (
return content.slice(0, block.start).replace(replaceRE, ' ') return content.slice(0, block.start).replace(replaceRE, ' ')
} else { } else {
var offset = content.slice(0, block.start).split(splitRE).length; var offset = content.slice(0, block.start).split(splitRE).length;
var padChar = block.type === 'script' && !block.lang var lang = block.attrs && block.attrs.lang; // fixed by xxxxxx
var padChar = block.type === 'script' && !block.lang && !isCustomBlock(lang || '')
? '//\n' ? '//\n'
: '\n'; : '\n';
return Array(offset).join(padChar) return Array(offset).join(padChar)
...@@ -2804,8 +2806,8 @@ Dep.prototype.removeSub = function removeSub (sub) { ...@@ -2804,8 +2806,8 @@ Dep.prototype.removeSub = function removeSub (sub) {
}; };
Dep.prototype.depend = function depend () { Dep.prototype.depend = function depend () {
if (Dep.target) { if (Dep.SharedObject.target) {
Dep.target.addDep(this); Dep.SharedObject.target.addDep(this);
} }
}; };
...@@ -2826,7 +2828,11 @@ Dep.prototype.notify = function notify () { ...@@ -2826,7 +2828,11 @@ Dep.prototype.notify = function notify () {
// The current target watcher being evaluated. // The current target watcher being evaluated.
// This is globally unique because only one watcher // This is globally unique because only one watcher
// can be evaluated at a time. // can be evaluated at a time.
Dep.target = null; // fixed by xxxxxx (nvue shared vuex)
/* eslint-disable no-undef */
Dep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {};
Dep.SharedObject.target = null;
Dep.SharedObject.targetStack = [];
/* */ /* */
...@@ -2945,7 +2951,9 @@ var Observer = function Observer (value) { ...@@ -2945,7 +2951,9 @@ var Observer = function Observer (value) {
def(value, '__ob__', this); def(value, '__ob__', this);
if (Array.isArray(value)) { if (Array.isArray(value)) {
if (hasProto) { if (hasProto) {
protoAugment(value, arrayMethods); {
protoAugment(value, arrayMethods);
}
} else { } else {
copyAugment(value, arrayMethods, arrayKeys); copyAugment(value, arrayMethods, arrayKeys);
} }
...@@ -3057,7 +3065,7 @@ function defineReactive$$1 ( ...@@ -3057,7 +3065,7 @@ function defineReactive$$1 (
configurable: true, configurable: true,
get: function reactiveGetter () { get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val; var value = getter ? getter.call(obj) : val;
if (Dep.target) { if (Dep.SharedObject.target) { // fixed by xxxxxx
dep.depend(); dep.depend();
if (childOb) { if (childOb) {
childOb.dep.depend(); childOb.dep.depend();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册