UNPKG

@antmjs/vantui

Version:

一套适用于Taro3及React的vantui组件库

35 lines (34 loc) 821 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.jumpLink = jumpLink; var _taro = require("@tarojs/taro"); function jumpLink(url, linkType) { var _linkType; linkType = (_linkType = linkType) !== null && _linkType !== void 0 ? _linkType : 'navigateTo'; if (url) { if (linkType === 'navigateTo' && (0, _taro.getCurrentPages)().length > 9) { (0, _taro.redirectTo)({ url: url }); } else { switch (linkType) { case 'navigateTo': (0, _taro.navigateTo)({ url: url }); break; case 'reLaunch': (0, _taro.reLaunch)({ url: url }); break; case 'redirectTo': (0, _taro.redirectTo)({ url: url }); } } } }