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

build:all

上级 46d679a8
......@@ -89,9 +89,9 @@ module.exports = {
replacement: resolve('src/core/helpers/protocol')
}]
}),
nodeResolve(),
commonjs(),
nodeResolve(),
requireContext(),
commonjs(),
replace({
__GLOBAL__: 'getGlobalUni()',
__PLATFORM__: JSON.stringify(process.env.UNI_PLATFORM),
......
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,function(){"use strict";function i(e,n){var i={options:{timestamp:+new Date},name:e,arg:n};if(window.__dcloud_weex_postMessage||window.__dcloud_weex_){if("postMessage"===e){var t={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(t):window.__dcloud_weex_.postMessage(JSON.stringify(t))}var o={type:c,args:{data:i,webviewIds:w}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(o):window.__dcloud_weex_.postMessageToService(JSON.stringify(o))}if(!window.plus)return window.parent.postMessage({type:c,data:i,pageId:""},"*");if(0===w.length){var a=plus.webview.currentWebview();if(!a)throw new Error("plus.webview.currentWebview() is undefined");var d=a.parent(),r="";r=d?d.id:a.id,w.push(r)}if(plus.webview.getWebviewById(u))plus.webview.postMessageToUniNView({type:c,args:{data:i,webviewIds:w}},u);else{var s=JSON.stringify(i);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat(c,'",').concat(s,",").concat(JSON.stringify(w),");"))}}var w=[],u="__uniapp__service",c="WEB_INVOKE_APPSERVICE",n={navigateTo:function(e){var n=(0<arguments.length&&void 0!==e?e:{}).url;i("navigateTo",{url:encodeURI(n)})},navigateBack:function(e){var n=(0<arguments.length&&void 0!==e?e:{}).delta;i("navigateBack",{delta:parseInt(n)||1})},switchTab:function(e){var n=(0<arguments.length&&void 0!==e?e:{}).url;i("switchTab",{url:encodeURI(n)})},reLaunch:function(e){var n=(0<arguments.length&&void 0!==e?e:{}).url;i("reLaunch",{url:encodeURI(n)})},redirectTo:function(e){var n=(0<arguments.length&&void 0!==e?e:{}).url;i("redirectTo",{url:encodeURI(n)})},getEnv:function(e){window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(e){i("postMessage",(0<arguments.length&&void 0!==e?e:{}).data||{})}},t=/uni-app/i.test(navigator.userAgent),o=/complete|loaded|interactive/;var a=window.my&&-1<navigator.userAgent.indexOf("AlipayClient");var d=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var r=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var s=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var g=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);for(var e,v=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},p=[function(e){if(t)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&o.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),n},function(e){if(g)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(r)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(a){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(d)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(s)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){return document.addEventListener("DOMContentLoaded",e),n}],l=0;l<p.length&&!(e=p[l](v));l++);e=e||{};var f="undefined"!=typeof uni?uni:{};if(!f.navigateTo)for(var _ in e)e.hasOwnProperty(_)&&(f[_]=e[_]);return f.webView=e,f});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).uni=n()}(this,(function(){"use strict";try{var e={};Object.defineProperty(e,"passive",{get:function(){!0}}),window.addEventListener("test-passive",null,e)}catch(e){}var n=Object.prototype.hasOwnProperty;function t(e,t){return n.call(e,t)}var i=[],a=function(e,n){var t={options:{timestamp:+new Date},name:e,arg:n};if(window.__dcloud_weex_postMessage||window.__dcloud_weex_){if("postMessage"===e){var a={data:[n]};return window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessage(a):window.__dcloud_weex_.postMessage(JSON.stringify(a))}var o={type:"WEB_INVOKE_APPSERVICE",args:{data:t,webviewIds:i}};window.__dcloud_weex_postMessage?window.__dcloud_weex_postMessageToService(o):window.__dcloud_weex_.postMessageToService(JSON.stringify(o))}if(!window.plus)return window.parent.postMessage({type:"WEB_INVOKE_APPSERVICE",data:t,pageId:""},"*");if(0===i.length){var r=plus.webview.currentWebview();if(!r)throw new Error("plus.webview.currentWebview() is undefined");var d=r.parent(),s="";s=d?d.id:r.id,i.push(s)}if(plus.webview.getWebviewById("__uniapp__service"))plus.webview.postMessageToUniNView({type:"WEB_INVOKE_APPSERVICE",args:{data:t,webviewIds:i}},"__uniapp__service");else{var w=JSON.stringify(t);plus.webview.getLaunchWebview().evalJS('UniPlusBridge.subscribeHandler("'.concat("WEB_INVOKE_APPSERVICE",'",').concat(w,",").concat(JSON.stringify(i),");"))}},o={navigateTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("navigateTo",{url:encodeURI(n)})},navigateBack:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.delta;a("navigateBack",{delta:parseInt(n)||1})},switchTab:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("switchTab",{url:encodeURI(n)})},reLaunch:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("reLaunch",{url:encodeURI(n)})},redirectTo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.url;a("redirectTo",{url:encodeURI(n)})},getEnv:function(e){window.plus?e({plus:!0}):e({h5:!0})},postMessage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a("postMessage",e.data||{})}},r=/uni-app/i.test(navigator.userAgent),d=/complete|loaded|interactive/;var s=window.my&&navigator.userAgent.indexOf("AlipayClient")>-1;var w=window.swan&&window.swan.webView&&/swan/i.test(navigator.userAgent);var u=window.qq&&window.qq.miniProgram&&/QQ/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var c=window.tt&&window.tt.miniProgram&&/toutiaomicroapp/i.test(navigator.userAgent);var g=window.wx&&window.wx.miniProgram&&/micromessenger/i.test(navigator.userAgent)&&/miniProgram/i.test(navigator.userAgent);var v=window.qa&&/quickapp/i.test(navigator.userAgent);for(var p,l=function(){window.UniAppJSBridge=!0,document.dispatchEvent(new CustomEvent("UniAppJSBridgeReady",{bubbles:!0,cancelable:!0}))},_=[function(e){if(r)return window.__dcloud_weex_postMessage||window.__dcloud_weex_?document.addEventListener("DOMContentLoaded",e):window.plus&&d.test(document.readyState)?setTimeout(e,0):document.addEventListener("plusready",e),o},function(e){if(g)return window.WeixinJSBridge&&window.WeixinJSBridge.invoke?setTimeout(e,0):document.addEventListener("WeixinJSBridgeReady",e),window.wx.miniProgram},function(e){if(u)return window.QQJSBridge&&window.QQJSBridge.invoke?setTimeout(e,0):document.addEventListener("QQJSBridgeReady",e),window.qq.miniProgram},function(e){if(s){document.addEventListener("DOMContentLoaded",e);var n=window.my;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){if(w)return document.addEventListener("DOMContentLoaded",e),window.swan.webView},function(e){if(c)return document.addEventListener("DOMContentLoaded",e),window.tt.miniProgram},function(e){if(v){window.QaJSBridge&&window.QaJSBridge.invoke?setTimeout(e,0):document.addEventListener("QaJSBridgeReady",e);var n=window.qa;return{navigateTo:n.navigateTo,navigateBack:n.navigateBack,switchTab:n.switchTab,reLaunch:n.reLaunch,redirectTo:n.redirectTo,postMessage:n.postMessage,getEnv:n.getEnv}}},function(e){return document.addEventListener("DOMContentLoaded",e),o}],f=0;f<_.length&&!(p=_[f](l));f++);p||(p={});var m="undefined"!=typeof uni?uni:{};if(!m.navigateTo)for(var E in p)t(p,E)&&(m[E]=p[E]);return m.webView=p,m}));
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
const protocols = {};
......@@ -376,7 +374,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -538,7 +536,7 @@ function wrapper$1 (webview) {
return
}
const maskColor = webview.__uniapp_mask;
let maskWebview = webview.__uniapp_mask_id === '0' ? {
const maskWebview = webview.__uniapp_mask_id === '0' ? {
setStyle ({
mask
}) {
......@@ -584,8 +582,6 @@ function getSubNVueById (id) {
return webview
}
var api = /*#__PURE__*/Object.freeze({
__proto__: null,
getSubNVueById: getSubNVueById,
......@@ -774,14 +770,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -793,11 +789,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -866,7 +862,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1057,11 +1053,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1317,7 +1313,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
// 不支持的 API 列表
......@@ -803,7 +801,7 @@ const protocols = { // 需要做转换的 API 列表
chooseAddress: {
name: 'getAddress',
returnValue (result) {
let info = result.result || {};
const info = result.result || {};
result.userName = info.fullname;
result.provinceName = info.prov;
result.cityName = info.city;
......@@ -828,7 +826,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -1234,14 +1232,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -1253,11 +1251,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -1326,7 +1324,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1517,11 +1515,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -2001,7 +1999,7 @@ const hooks$1 = [
hooks$1.push(...PAGE_EVENT_HOOKS);
function parsePage (vuePageOptions) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vuePageOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vuePageOptions);
const pageOptions = {
mixins: initBehaviors(vueOptions, initBehavior),
......@@ -2110,7 +2108,7 @@ function initVm (VueComponent) {
}
function parseComponent (vueComponentOptions) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const properties = initProperties(vueOptions.props, false, vueOptions.__file);
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
var previewImage = {
......@@ -519,7 +517,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -886,14 +884,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -905,11 +903,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -994,7 +992,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1195,11 +1193,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1451,7 +1449,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......@@ -1579,9 +1577,9 @@ function parseComponent (vueOptions) {
}
componentOptions.messages = {
'__l': componentOptions.methods['__l']
__l: componentOptions.methods.__l
};
delete componentOptions.methods['__l'];
delete componentOptions.methods.__l;
return componentOptions
}
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
var previewImage = {
......@@ -479,7 +477,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -646,8 +644,6 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit: $emit
});
var api = /*#__PURE__*/Object.freeze({
__proto__: null
});
......@@ -829,14 +825,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -848,11 +844,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -921,7 +917,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1112,11 +1108,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1369,7 +1365,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......@@ -1379,8 +1375,8 @@ function parseBaseComponent (vueComponentOptions, {
{
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) {
Object.assign(options, vueOptions['mp-weixin']['options']);
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
Object.assign(options, vueOptions['mp-weixin'].options);
}
}
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
var previewImage = {
......@@ -571,7 +569,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -738,8 +736,6 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit: $emit
});
var api = /*#__PURE__*/Object.freeze({
__proto__: null
});
......@@ -921,14 +917,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -940,11 +936,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -1013,7 +1009,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1204,11 +1200,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1541,7 +1537,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
var previewImage = {
......@@ -431,7 +429,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -598,8 +596,6 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit: $emit
});
var api = /*#__PURE__*/Object.freeze({
__proto__: null
});
......@@ -786,14 +782,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -805,11 +801,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -878,7 +874,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1069,11 +1065,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1322,7 +1318,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......@@ -1332,8 +1328,8 @@ function parseBaseComponent (vueComponentOptions, {
{
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) {
Object.assign(options, vueOptions['mp-weixin']['options']);
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
Object.assign(options, vueOptions['mp-weixin'].options);
}
}
......
......@@ -8,7 +8,7 @@ function parseData (data, vueComponentOptions) {
}
function parseComponents (vueComponentOptions) {
vueComponentOptions.components = global['__wxVueOptions'].components;
vueComponentOptions.components = global.__wxVueOptions.components;
}
const _toString = Object.prototype.toString;
......@@ -50,11 +50,11 @@ const camelize = cached((str) => {
const SOURCE_KEY = '__data__';
const COMPONENT_LIFECYCLE = {
'created': 'onServiceCreated',
'attached': 'onServiceAttached',
'ready': 'mounted',
'moved': 'moved',
'detached': 'destroyed'
created: 'onServiceCreated',
attached: 'onServiceAttached',
ready: 'mounted',
moved: 'moved',
detached: 'destroyed'
};
const COMPONENT_LIFECYCLE_KEYS = Object.keys(COMPONENT_LIFECYCLE);
......@@ -135,7 +135,7 @@ function parseMethods (methods, vueComponentOptions) {
return
}
if (methods.$emit) {
console.warn(`Method "$emit" conflicts with an existing Vue instance method`);
console.warn('Method "$emit" conflicts with an existing Vue instance method');
delete methods.$emit;
}
vueComponentOptions.methods = methods;
......@@ -299,7 +299,7 @@ function parseRelations (relations, vueComponentOptions) {
Object.keys(relations).forEach(name => {
const relation = relations[name];
relation.name = name;
relation.target = relation.target ? String(relation.target) : relative(global['__wxRoute'], name);
relation.target = relation.target ? String(relation.target) : relative(global.__wxRoute, name);
});
vueComponentOptions.mpOptions.relations = relations;
}
......@@ -772,23 +772,23 @@ var polyfill = {
}
};
global['__wxRoute'] = '';
global['__wxComponents'] = Object.create(null);
global['__wxVueOptions'] = Object.create(null);
global.__wxRoute = '';
global.__wxComponents = Object.create(null);
global.__wxVueOptions = Object.create(null);
function Page (options) {
const pageOptions = parsePage(options);
pageOptions.mixins.unshift(polyfill);
pageOptions.mpOptions.path = global['__wxRoute'];
global['__wxComponents'][global['__wxRoute']] = pageOptions;
pageOptions.mpOptions.path = global.__wxRoute;
global.__wxComponents[global.__wxRoute] = pageOptions;
}
function initRelationsHandler (vueComponentOptions) {
// linked 需要在当前组件 attached 之后再执行
if (!vueComponentOptions['onServiceAttached']) {
vueComponentOptions['onServiceAttached'] = [];
if (!vueComponentOptions.onServiceAttached) {
vueComponentOptions.onServiceAttached = [];
}
vueComponentOptions['onServiceAttached'].push(function onServiceAttached () {
vueComponentOptions.onServiceAttached.push(function onServiceAttached () {
handleRelations(this, 'linked');
});
}
......@@ -796,9 +796,9 @@ function initRelationsHandler (vueComponentOptions) {
function Component (options) {
const componentOptions = parseComponent(options);
componentOptions.mixins.unshift(polyfill);
componentOptions.mpOptions.path = global['__wxRoute'];
componentOptions.mpOptions.path = global.__wxRoute;
initRelationsHandler(componentOptions);
global['__wxComponents'][global['__wxRoute']] = componentOptions;
global.__wxComponents[global.__wxRoute] = componentOptions;
}
function Behavior (options) {
......
......@@ -348,14 +348,12 @@ const interceptors = {
promiseInterceptor
};
var baseApi = /*#__PURE__*/Object.freeze({
__proto__: null,
upx2px: upx2px,
interceptors: interceptors,
addInterceptor: addInterceptor,
removeInterceptor: removeInterceptor
removeInterceptor: removeInterceptor,
interceptors: interceptors
});
var previewImage = {
......@@ -412,7 +410,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
if (isFn(argsOption)) {
argsOption = argsOption(fromArgs, toArgs) || {};
}
for (let key in fromArgs) {
for (const key in fromArgs) {
if (hasOwn(argsOption, key)) {
let keyOption = argsOption[key];
if (isFn(keyOption)) {
......@@ -587,8 +585,6 @@ var eventApi = /*#__PURE__*/Object.freeze({
$emit: $emit
});
var api = /*#__PURE__*/Object.freeze({
__proto__: null
});
......@@ -770,14 +766,14 @@ function createObserver (name) {
}
function initBehaviors (vueOptions, initBehavior) {
const vueBehaviors = vueOptions['behaviors'];
const vueExtends = vueOptions['extends'];
const vueMixins = vueOptions['mixins'];
const vueBehaviors = vueOptions.behaviors;
const vueExtends = vueOptions.extends;
const vueMixins = vueOptions.mixins;
let vueProps = vueOptions['props'];
let vueProps = vueOptions.props;
if (!vueProps) {
vueOptions['props'] = vueProps = [];
vueOptions.props = vueProps = [];
}
const behaviors = [];
......@@ -789,11 +785,11 @@ function initBehaviors (vueOptions, initBehavior) {
vueProps.push('name');
vueProps.push('value');
} else {
vueProps['name'] = {
vueProps.name = {
type: String,
default: ''
};
vueProps['value'] = {
vueProps.value = {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
};
......@@ -862,7 +858,7 @@ function initProperties (props, isBehavior = false, file = '') {
Object.keys(props).forEach(key => {
const opts = props[key];
if (isPlainObject(opts)) { // title:{type:String,default:''}
let value = opts['default'];
let value = opts.default;
if (isFn(value)) {
value = value();
}
......@@ -1053,11 +1049,11 @@ function handleEvent (event) {
// [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
const dataset = (event.currentTarget || event.target).dataset;
if (!dataset) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
if (!eventOpts) {
return console.warn(`事件信息不存在`)
return console.warn('事件信息不存在')
}
// [['handle',[1,2,a]],['handle1',[1,2,a]]]
......@@ -1371,7 +1367,7 @@ function parseBaseComponent (vueComponentOptions, {
isPage,
initRelation
} = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);
const options = {
multipleSlots: true,
......
......@@ -2,10 +2,12 @@
<div
:class="viewClass"
class="uni-button"
v-on="$listeners">
v-on="$listeners"
>
<text
:class="textClass"
class="uni-button-t">
class="uni-button-t"
>
<slot />
</text>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册