提交 103c8fdc 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 bfba2f94
dist
\ No newline at end of file
此差异已折叠。
import { isPlainObject } from '@vue/shared'
import { isPlainObject } from '@vue/shared';
const NAVBAR_HEIGHT = 44
const TABBAR_HEIGHT = 50
const COMPONENT_NAME_PREFIX = 'VUni'
const NAVBAR_HEIGHT = 44;
const TABBAR_HEIGHT = 50;
const COMPONENT_NAME_PREFIX = 'VUni';
function debounce(fn, delay) {
let timeout
const newFn = function() {
clearTimeout(timeout)
const timerFn = () => fn.apply(this, arguments)
timeout = setTimeout(timerFn, delay)
}
newFn.cancel = function() {
clearTimeout(timeout)
}
return newFn
let timeout;
const newFn = function () {
clearTimeout(timeout);
const timerFn = () => fn.apply(this, arguments);
timeout = setTimeout(timerFn, delay);
};
newFn.cancel = function () {
clearTimeout(timeout);
};
return newFn;
}
function plusReady(callback) {
if (typeof callback !== 'function') {
return
return;
}
if (window.plus) {
return callback()
return callback();
}
document.addEventListener('plusready', callback)
document.addEventListener('plusready', callback);
}
const encode = encodeURIComponent
const encode = encodeURIComponent;
function stringifyQuery(obj, encodeStr = encode) {
const res = obj
? Object.keys(obj)
.map(key => {
let val = obj[key]
let val = obj[key];
if (typeof val === undefined || val === null) {
val = ''
} else if (isPlainObject(val)) {
val = JSON.stringify(val)
val = '';
}
return encodeStr(key) + '=' + encodeStr(val)
else if (isPlainObject(val)) {
val = JSON.stringify(val);
}
return encodeStr(key) + '=' + encodeStr(val);
})
.filter(x => x.length > 0)
.join('&')
: null
return res ? `?${res}` : ''
: null;
return res ? `?${res}` : '';
}
const TAGS = [
......@@ -105,18 +106,9 @@ const TAGS = [
'uni-video',
'uni-view',
'uni-web-view'
]
];
function isCustomElement(tag) {
return TAGS.indexOf(tag) !== -1
return TAGS.indexOf(tag) !== -1;
}
export {
COMPONENT_NAME_PREFIX,
NAVBAR_HEIGHT,
TABBAR_HEIGHT,
TAGS,
debounce,
isCustomElement,
plusReady,
stringifyQuery
}
export { COMPONENT_NAME_PREFIX, NAVBAR_HEIGHT, TABBAR_HEIGHT, TAGS, debounce, isCustomElement, plusReady, stringifyQuery };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册