warningUnChecked.js 699 B

123456789101112131415161718
  1. import { miniprogramThis } from '../internals/global'
  2. import { getSystemInfoSync } from '../hooks/useNativeAPI'
  3. import { compareVersion } from './compareVersion'
  4. const libVersion = '2.6.6'
  5. // check SDKVersion
  6. export function warningUnChecked() {
  7. const { platform, SDKVersion } = getSystemInfoSync()
  8. if (platform === 'devtools' && compareVersion(SDKVersion, libVersion) < 0) {
  9. if (miniprogramThis.showModal) {
  10. miniprogramThis.showModal({
  11. title: '提示',
  12. content: `当前基础库版本(${SDKVersion})过低,无法使用 Wux Weapp 组件库,请更新基础库版本 >=${libVersion} 后重试。`,
  13. })
  14. }
  15. }
  16. }