0.0.16 • Published 11 months ago

@hsdata/web-core v0.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

@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'

注意事项:

0.0.15

12 months ago

0.0.16

11 months ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

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