Skip to content

Commit 40c85f7

Browse files
committed
1 parent cb13df3 commit 40c85f7

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

Diff for: packages/weex-template-compiler/build.js

+15-20
Original file line numberDiff line numberDiff line change
@@ -5121,14 +5121,12 @@ function transformNode (el, options) {
51215121
var ref = parseStaticClass(staticClass, options);
51225122
var dynamic = ref.dynamic;
51235123
var classResult = ref.classResult;
5124-
if (dynamic) {
5125-
if (process.env.NODE_ENV !== 'production') {
5126-
warn(
5127-
"class=\"" + staticClass + "\": " +
5128-
'Interpolation inside attributes has been deprecated. ' +
5129-
'Use v-bind or the colon shorthand instead.'
5130-
);
5131-
}
5124+
if (process.env.NODE_ENV !== 'production' && dynamic && staticClass) {
5125+
warn(
5126+
"class=\"" + staticClass + "\": " +
5127+
'Interpolation inside attributes has been deprecated. ' +
5128+
'Use v-bind or the colon shorthand instead.'
5129+
);
51325130
}
51335131
if (!dynamic && classResult) {
51345132
el.staticClass = classResult;
@@ -5189,14 +5187,12 @@ function transformNode$1 (el, options) {
51895187
var ref = parseStaticStyle(staticStyle, options);
51905188
var dynamic = ref.dynamic;
51915189
var styleResult = ref.styleResult;
5192-
if (dynamic) {
5193-
if (process.env.NODE_ENV !== 'production') {
5194-
warn(
5195-
"style=\"" + staticStyle + "\": " +
5196-
'Interpolation inside attributes has been deprecated. ' +
5197-
'Use v-bind or the colon shorthand instead.'
5198-
);
5199-
}
5190+
if (process.env.NODE_ENV !== 'production' && dynamic) {
5191+
warn(
5192+
"style=\"" + (String(staticStyle)) + "\": " +
5193+
'Interpolation inside attributes has been deprecated. ' +
5194+
'Use v-bind or the colon shorthand instead.'
5195+
);
52005196
}
52015197
if (!dynamic && styleResult) {
52025198
el.staticStyle = styleResult;
@@ -5310,7 +5306,6 @@ function getTagNamespace$1 () { /* console.log('getTagNamespace') */ }
53105306
var cache = Object.create(null);
53115307

53125308
var baseOptions = {
5313-
53145309
preserveWhitespace: false,
53155310
modules: modules,
53165311
staticKeys: genStaticKeys(modules),
@@ -5319,7 +5314,6 @@ var baseOptions = {
53195314
isUnaryTag: isUnaryTag$1,
53205315
mustUseProp: mustUseProp$1,
53215316
getTagNamespace: getTagNamespace$1
5322-
53235317
};
53245318

53255319
function compile$1 (
@@ -5351,9 +5345,10 @@ function compile$$1 (
53515345
options = options || {};
53525346
var errors = [];
53535347
// allow injecting modules/directives
5348+
var baseModules = baseOptions.modules || [];
53545349
var modules = options.modules
5355-
? baseOptions.modules.concat(options.modules)
5356-
: baseOptions.modules;
5350+
? baseModules.concat(options.modules)
5351+
: baseModules;
53575352
var directives = options.directives
53585353
? extend(extend({}, baseOptions.directives), options.directives)
53595354
: baseOptions.directives;

Diff for: packages/weex-vue-framework/index.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -4252,16 +4252,20 @@ function updateClass (oldVnode, vnode) {
42524252
}
42534253

42544254
var oldClassList = [];
4255-
if (oldData.staticClass) {
4256-
oldClassList.push.apply(oldClassList, oldData.staticClass);
4255+
// unlike web, weex vnode staticClass is an Array
4256+
var oldStaticClass = oldData.staticClass;
4257+
if (oldStaticClass) {
4258+
oldClassList.push.apply(oldClassList, oldStaticClass);
42574259
}
42584260
if (oldData.class) {
42594261
oldClassList.push.apply(oldClassList, oldData.class);
42604262
}
42614263

42624264
var classList = [];
4263-
if (data.staticClass) {
4264-
classList.push.apply(classList, data.staticClass);
4265+
// unlike web, weex vnode staticClass is an Array
4266+
var staticClass = data.staticClass;
4267+
if (staticClass) {
4268+
classList.push.apply(classList, staticClass);
42654269
}
42664270
if (data.class) {
42674271
classList.push.apply(classList, data.class);
@@ -4274,6 +4278,8 @@ function updateClass (oldVnode, vnode) {
42744278
}
42754279

42764280
function getStyle (oldClassList, classList, ctx) {
4281+
// style is a weex-only injected object
4282+
// compiled from <style> tags in weex files
42774283
var stylesheet = ctx.$options.style || {};
42784284
var result = {};
42794285
classList.forEach(function (name) {
@@ -4440,6 +4446,8 @@ Vue$1.prototype.$mount = function (
44404446
return this._mount(el && query(el, this.$document), hydrating)
44414447
};
44424448

4449+
Vue$1.weexVersion = '2.0.5-weex.1';
4450+
44434451
var instances = renderer.instances;
44444452
var modules = renderer.modules;
44454453
var components = renderer.components;

Diff for: src/entries/weex-framework.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Vue from 'weex/runtime/index'
22
import renderer from 'weex/runtime/config'
33

4+
Vue.weexVersion = '2.0.5-weex.1'
5+
46
const {
57
instances,
68
modules,

0 commit comments

Comments
 (0)