npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

y-wx-utils

v1.0.0

Published

微信h5、小程序开发使用的相关工具方法汇总

Downloads

2

Readme

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 |