0.0.11 • Published 1 year ago

@wanghaofeng/tools v0.0.11

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

安装

pnpm add @wanghaofeng/tools
# or
yarn add @wanghaofeng/tools

使用

to 函数

// demo.ts
import { to } from '@wanghaofeng/tools'

const fetchSomething = asyncc () => {
    const [err, res] = await to(fetch('xxxx'))
    return res?.json()
}

storage

import { storage } from "@wanghaofeng/tools";

storage.setLs("test", { a: 1, b: 2 });
storage.getLs("test");
storage.delLs("test");

systemUpdate

  • vue 项目使用
<!-- App.vue -->
<template>
   <!-- ........... -->
</template>
<script setup lang="ts">
import { SystemUpdate } from '@wanghaofeng/tools'
import { onMounted, onUnMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'

const su = ref<SystemUpdate>(null)

onMounted(() => {
  su.value = new SystemUpdate(30)
  su.value.on(() => {
    ElMessage({
      message: '系统有更新,请重新清理下浏览器缓存,重新加载页面',
      type: 'warning',
    })
  })
)

onUnMounted(() => {
  su.value.destroy()
})
</script>

git config --global http.sslVerify false git config --global --unset https.proxy git config --global --unset http.proxy

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago