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

@hsdata/web-core

v0.0.16

Published

provides dependency injection

Downloads

19

Readme

@hsdata/web-core

提供统一的 Vue 初始化,第三方组件的注入,vue 原型挂载等功能。

初始化已包含的功能

  • Vue 实例化;
  • dui-vue 注册、ant-design-vue 注册、vxe-table 注册;
  • DUtils 挂载到 Vue 原型:this.$DUtils
  • Storage 挂载到 Vue 原型:this.$storage,默认挂载localStorage
    • get(key,[def]) // 获取存储值
    • save(key,value) // 设置存储值
    • clear(key) // 清除
    • saveTemp(key, val) // 存储临时值
    • getTemp(key,[def]) // 获取临时值
  • Io 挂载到 Vue 原型:this.$iothis.$getthis.$postthis.$upload

安装和使用

// 安装:
yarn add @hsdata/web-core

// 使用:
import WebCore from '@hsdata/web-core'

new WebCore(opts)

opts 配置说明

  • Opts 配置项:Object
    • el:string | HTMLElement,Vue 挂载的元素;默认:#app
    • render:(h)=> h,vue 渲染模板;
    • sysConfig:Object,系统配置参数,会挂载到 Vue 原型上,通过this.$$config访问;
    • store:Store,必须是已实例化的 Store 对象;
    • router:VueRouter,必须是已实例化的 Router 对象;
    • duiConfig:Object,dui-vue 组件初始化的参数;默认:{ apiVersion:'v2' }
    • initBefore:(VuePrototype,next)=> next(),初始化之前的函数,必须调用 netx();
    • initAfter:(vue)=>{},初始化之后的函数,参数是实例化之后的 vue;
    • io:Object,通过 Dio 实例化的对象;

导出的功能

import {
  Dio, // 和dui-vue库的IO用法一致
  storage, // 当前已实例化的storage
  sessionStorage,
  localStorage,
  cookie,
  DUtils,
  MutationTypes // vuex mutation的所有类型
} from '@hsdata/web-core'

注意事项: