1 Star 0 Fork 0

湘山神木 / y-wx-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
WTFPL

y-wx-utils

介绍

微信h5公众号、小程序开发使用的相关工具方法库

安装教程

  npm i y-wx-utils -S

使用教程

  • 全局引入使用
// vue应用main.ts 或 taro 小程序工程 app.ts 入口文件引入注册
import Vue from 'vue';
import yWxUtils from 'y-wx-utils';
Vue.prototype.$wxUtils = yWxUtils;

// 页面组件中使用
this.$wxUtils.xxx

  • 按需局部引入使用
// 或按需引入
import {common, wxh5, wxMiniProgram} from 'y-wx-utils';

// 获取数据类型
const dataType = common.getDataType();
// 检测是否微信浏览器环境
const isWxBrowser = wxh5.checkWxBrowser();

  • 单独引入某个函数方法
import {getDataType, checkWxBrowser} from "y-wx-utils";

// 获取数据类型
const dataType = getDataType();
// 检测是否微信浏览器环境
const isWxBrowser = checkWxBrowser();

工具方法介绍

工具方法 作用 模块
getDataType 获取数据类型 common
deepClone 深度克隆数据对象 common
convertCodeURIParams 微信小程序url传参,url参数转换 common
filterHtmlStringByWhite 输入框、富文本等输入的特殊字符,如标签转义过滤方法 common
checkWxBrowser 检测是否微信浏览器环境 wxh5
getPhoneType 获取手机操作系统型号 wxh5
getUrlQueryParam url中query参数转换获取 wxh5
wxOaLogin 微信H5公众号登录方法 wxh5
getWxCode 微信H5公众号发起登录后获取code wxh5
backToWxOaMenu 微信公众号H5手动回退到公众号菜单窗口 wxh5
disabledWxOaBackHistoryRoute 禁用历史路由回退 wxh5
getTaroMiniProgramElementRect taro小程序获取元素相关位置信息 wxMiniProgram
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.

简介

微信h5公众号、小程序开发使用的相关工具方法库 展开 收起
TypeScript
WTFPL
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/xiangshanxiumu/y-wx-utils.git
git@gitee.com:xiangshanxiumu/y-wx-utils.git
xiangshanxiumu
y-wx-utils
y-wx-utils
master

搜索帮助