mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
fix: 修复插件内使用 van-tabs 切换 tab 报错的问题 (#5073)
* 修复插件内使用van-tabs切换tab报错的问题 * fix(van-tabs): 修复小程序插件内使用van-tabs切换tab没有反应的问题 feat(van-tabs): incorrect style docs(van-tabs): 去除utils,version里面require循环依赖,修复插件内调用wx.canIUse抛异常问题 * fix(van-tabs): 修复小程序插件内使用van-tabs切换tab没有反应的问题 feat(van-tabs): incorrect style docs(van-tabs): 去除utils,version里面require循环依赖,修复插件内调用wx.canIUse抛异常问题 * fix(van-tabs): incorrect style feat(van-tabs): incorrect style docs(van-tabs): incorrect style
This commit is contained in:
parent
a41e7734eb
commit
186b0156df
@ -1,7 +1,8 @@
|
|||||||
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
||||||
import { canIUseGroupSetData, canIUseNextTick } from './version';
|
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync } from './version';
|
||||||
|
|
||||||
export { isDef } from './validator';
|
export { isDef } from './validator';
|
||||||
|
export { getSystemInfoSync } from './version';
|
||||||
|
|
||||||
export function range(num: number, min: number, max: number) {
|
export function range(num: number, min: number, max: number) {
|
||||||
return Math.min(Math.max(num, min), max);
|
return Math.min(Math.max(num, min), max);
|
||||||
@ -17,15 +18,6 @@ export function nextTick(cb: (...args: any[]) => void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let systemInfo: WechatMiniprogram.SystemInfo;
|
|
||||||
export function getSystemInfoSync() {
|
|
||||||
if (systemInfo == null) {
|
|
||||||
systemInfo = wx.getSystemInfoSync();
|
|
||||||
}
|
|
||||||
|
|
||||||
return systemInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function addUnit(value?: string | number): string | undefined {
|
export function addUnit(value?: string | number): string | undefined {
|
||||||
if (!isDef(value)) {
|
if (!isDef(value)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
import { getSystemInfoSync } from './utils';
|
let systemInfo: WechatMiniprogram.SystemInfo;
|
||||||
|
export function getSystemInfoSync() {
|
||||||
|
if (systemInfo == null) {
|
||||||
|
systemInfo = wx.getSystemInfoSync();
|
||||||
|
}
|
||||||
|
|
||||||
|
return systemInfo;
|
||||||
|
}
|
||||||
|
|
||||||
function compareVersion(v1, v2) {
|
function compareVersion(v1, v2) {
|
||||||
v1 = v1.split('.');
|
v1 = v1.split('.');
|
||||||
@ -50,7 +57,11 @@ export function canIUseGroupSetData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canIUseNextTick() {
|
export function canIUseNextTick() {
|
||||||
return wx.canIUse('nextTick');
|
try {
|
||||||
|
return wx.canIUse('nextTick');
|
||||||
|
} catch (e) {
|
||||||
|
return gte('2.7.1');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function canIUseCanvas2d() {
|
export function canIUseCanvas2d() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user