hk-mssh-ui

web端的组件编写和集成
2,714
Install
npm install hk-mssh-ui
Latest Version:1.3.27
Vue:2
License:ISC
Last Updated:Apr 22, 2025
Links: npm
Maintainer: hong_kai

hk-mssh-ui

使用方法

import HKMSSHUI from 'hk-mssh-ui'
Vue.use(HKMSSHUI)

可用组件

const components = [
  hkDialog,
  hkImg,
  hkVideo,
  hkIcon,
  hkSvgIcon,
  hkSvgList,
  hkTable,
  hkTree,
  hkPage,
  hkSearch,
  hkSelectTree,
  hkUpload,
  hkContainer,
  hkUEditor,
  hkLayout,
  hkCard,
  hkColorPicker,
  hkScrollbar,
  hkTransfer
]
UI 自带一套后端布局,封装了部分常用功能
  • 使用方法
在项目的 store 中 ,如果要是用组件的Layout,则必须引入layoutStore

index.js 引入
import { layoutStore } from 'hk-mssh-ui'
export default new Vuex.Store({
  state: {},
  mutations: {},
  actions: {},
  modules: { layoutStore },
  getters
})
UI 关于应用额外的 svg 图标
  • 使用方法
首先下载图标存入项目

mian.js 引入
# 此处是重点
const req = require.context('./components/svg', false, /\.svg$/)
let svgList = []
const requireAll = requireContext => {
  svgList = requireContext.keys()
  return requireContext.keys().map(requireContext)
}
requireAll(req)

import hkMsshUi from '../publish/src'
hkMsshUi.addMoreSvgList(svgList)   # 调用项目添加的方法,此处主要用于菜单图标选择,如果不作为图标,仅仅是在项目中显示使用,则可以不用
Vue.use(hkMsshUi)


vue.config.js
# 此处要注意,放在打包配置节点
chainWebpack(config) {
    config.module
      .rule('svg')
      # 此处第一个add为本组件原始的svg,第二个add为当前项目使用的svg路径,同理可添加多个
      .exclude.add(resolve('publish/svg-icons')).add(resolve('src/components/svg'))
      .end()
    config.module
      .rule('icons')
      .test(/\.svg$/)
      .include.add(resolve('publish/svg-icons')).add(resolve('src/components/svg'))
      .end()
      .use('svg-sprite-loader')
      .loader('svg-sprite-loader')
      .options({
        symbolId: 'icon-[name]'
      })
      .end()
}

Related Packages

lj-publish-test3

A magical vue admin. Typical templates for enterprise applications. Newest devel...

12,812 90,127
loit-web-component-gx

广西时代凌宇前端组件库

7,272 2,595
vue-element-admin

A magical vue admin. Typical templates for enterprise applications. Newest devel...

2,674 90,127
zcomps-api-dev

A magical vue admin. Typical templates for enterprise applications. Newest devel...

2,216 90,132
zcomps-api-min

A magical vue admin. Typical templates for enterprise applications. Newest devel...

1,731 90,125

Version History

Version Released Vue License
1.3.27 ^2.6.14 ISC
1.3.3 2.6.11 ISC
1.1.35 2.6.11 ISC
1.1.25 2.6.11 ISC
1.1.23 2.6.11 ISC