0.1.6 • Published 2 years ago

hzb-ui v0.1.6

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

h-ui

安装

npm i hzb-ui

引入

全局引入

import HUi from 'hzb-ui';
import 'hzb-ui/lib/h-ui.css';
import Vue from 'vue';
Vue.use(HUi)

局部引入

import { HSelectTree } from 'hzb-ui';
import 'hzb-ui/lib/h-ui.css';
import Vue from 'vue';
Vue.use(HSelectTree)

使用

下拉树

<h-select-tree><h-select-tree/>

Attributes

参数说明类型可选值默认值
data数据源array----
value / v-model绑定值,单选返回数据本生,多选返回以英文逗号(,)拼接的字符串string
props配置选项,具体看下表object----
width下拉款宽度,支持px,%string--300px
multiple是否支持多选boolean--false
lazy是否懒加载子节点,需与 load 方法结合使用boolean--false
filterable是否支持搜索boolean--false
default-expand-all树节点是否全部展开boolean--false
size尺寸stringmedium / small / minismall
placeholder下拉框占位文本string----
checks-trictly在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 trueboolean--true
Props
参数说明类型可选值默认值
label指定节点标签为节点对象的某个属性值,用于显示文本string--
children指定子树为节点对象的某个属性值string--
value每个节点的唯一标识string--
disabled指定节点选择框是否禁用为节点对象的某个属性值boolean, function(data, node)--
isLeaf指定节点是否为叶子节点,仅在指定了 lazy 属性的情况下生效boolean, function(data, node)--

Events

事件名称说明回调参数
load加载子树数据的方法,仅当 lazy 属性为true 时生效function(node, resolve)
node-click节点被点击时的回调该节点所对应的对象
check当复选框被点击的时候触发共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性

轮播图

<h-swiper>
    <h-swiper-item></h-swiper-item>
<h-swiper/>

Attributes

参数说明类型可选值默认值
height轮播图高度string----
trigger指示器触发方式stringclick--
autoplay是否自动切换boolean--true
interval自动切换的时间间隔,单位为毫秒number--3000
arrow切换箭头的显示时机stringalways/hover/neverhover
direction轮播图方向stringhorizontal/verticalhorizontal

密码框

<h-password><h-password/>

Attributes

参数说明类型可选值默认值
value / v-model绑定值string/number----
size尺寸stringmedium / small / minismall
gutter密码框间距string / number----
span密码框数量string / number--6

图片预览

<h-preview-image><h-preview-image/>

Attributes

参数说明类型可选值默认值
visible.sync预览显示boolean----
srcList预览图片路劲array----
current当前显示图片。当为number时,为srcList下标;当为string是,传入对应图片地址string / number----