更新记录
1.0.2(2024-12-06) 下载此版本
新增axios风格的请求函数
1.0.1(2024-11-09) 下载此版本
修复部分函数无法使用的问题
1.0.0(2024-11-09) 下载此版本
测试发布
查看更多平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
× | √ | √ | √ | √ | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | √ | √ | √ | √ | √ | - | √ | √ | √ | √ |
其他
多语言 | 暗黑模式 | 宽屏模式 |
---|---|---|
× | × | √ |
Tycho-utils
获取节点信息
import {onReady} from '@dcloudio/uni-app';
import {getCurrentInstance} from 'vue';
import {useTemplateRef} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
const contentRef = useTemplateRef(getCurrentInstance(),'.content');
onReady(()=>{
contentRef.value.then(data => console.log(data,'拿到节点信息'));
})
获取微信胶囊信息
import {onLoad} from '@dcloudio/uni-app';
import {getMenuButtonBoundingClientRect} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
onLoad(() => {
const menuButton = getMenuButtonBoundingClientRect();
console.log(menuButton,'微信胶囊的布局信息');
})
本地存储
import {useStorage} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
const store = useStorage();
store.set('token',[1,2,3]);
store.get('token').then(data => console.log(data[0],'得到数据'));
文件上传
import {uploadFiles} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
const files = []; // 存储文件信息,通常通过uni.chooseImage得到
uploadFiles('url',files).then(data => console.log(data,'上传成功后得到的响应数据'));
加载
import {useLoading} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
const loading = useLoading();
loading.show('加载中');
setTimeout(()=>{
loading.hiden(); // 关闭加载状态
},2000);
轻提示
import {showToast} from '../../uni_modules/Tycho-utils/js_sdk/index.js';
showToast('轻提示','success',5000);