0.3.1 • Published 2 years ago
效果演示
vue create demo
npm install harderkai_ui
import ItcastUI from 'harderkai_ui'
import 'harderkai_ui/lib/harderkai_ui.css'
Vue.use(ItcastUI)
<template>
<div id="app">
<my-button type="success" @click="visible=true">显示登录框</my-button>
<my-dialog title="用户登录" :visible.sync="visible" width="30%">
<my-form :model="model" label-width="80px">
<my-form-item label="用户名">
<my-input v-model="model.username" placeholder="请输入用户名" clearable></my-input>
</my-form-item>
<my-form-item label="用户密码">
<my-input v-model="model.password" placeholder="请输入用户密码" show-password></my-input>
</my-form-item>
<my-form-item label="即时配送">
<my-switch v-model="model.soon" active-color="green" inactive-color="red"></my-switch>
</my-form-item>
<my-form-item label="爱好">
<my-checkbox-group v-model="model.hobby">
<my-checkbox label="篮球"></my-checkbox>
<my-checkbox label="足球"></my-checkbox>
<my-checkbox label="乒乓球"></my-checkbox>
</my-checkbox-group>
</my-form-item>
<my-form-item label="性别">
<my-radio-group v-model="model.gender">
<my-radio label="1">男</my-radio>
<my-radio label="0">女</my-radio>
</my-radio-group>
</my-form-item>
</my-form>
<template v-slot:footer>
<my-button type="primary" @click="login">登录</my-button>
<my-button @click="visible=false">取消</my-button>
</template>
</my-dialog>
</div>
</template>
my-button组件
参数支持
参数名 | 参数描述 | 参数类型 | 默认值 |
---|
type | 按钮类型(primary / success / warning / danger / info) | string | default |
plain | 是否是朴素按钮 | boolean | false |
round | 是否是圆角按钮 | boolean | false |
circle | 是否是圆形按钮 | boolean | false |
disabled | 是否禁用按钮 | boolean | false |
icon | 图标类名 | string | 无 |
事件支持
my-dialog组件
参数支持
参数名 | 参数描述 | 参数类型 | 默认值 |
---|
title | 对话框标题 | string | 提示 |
width | 宽度 | string | 50% |
top | 与顶部的距离 | string | 15vh |
visible | 是否显示dialog(支持sync修饰符) | boolean | false |
事件支持
事件名 | 事件描述 |
---|
opened | 模态框显示的事件 |
closed | 模态框关闭的事件 |
插槽说明
插槽名称 | 插槽描述 |
---|
default | dialog的内容 |
title | dialog的标题 |
footer | dialog的底部操作区 |
my-input组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
placeholder | 占位符 | string | 无 |
type | 文本框类型(text/password) | string | text |
disabled | 禁用 | boolean | false |
clearable | 是否显示清空按钮 | boolean | false |
show-password | 是否显示密码切换按钮 | boolean | false |
name | name属性 | string | 无 |
事件支持
事件名称 | 事件描述 |
---|
blur | 失去焦点事件 |
change | 内容改变事件 |
focus | 获取的焦点事件 |
my-switch组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | boolean | false |
name | name属性 | string | text |
activeColor | 自定义的激活的颜色 | string | |
inactiveColor | 自定义的不激活的颜色 | string | |
事件支持
事件名称 | 事件描述 |
---|
change | change时触发的事件 |
my-radio组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | boolean | false |
label | 单选框的value值 | string,num,boolean | '' |
name | name属性 | string | |
my-radio-group组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | boolean | false |
my-checkbox
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | 布尔类型 | false |
label | 单选框的value值 | string,num,boolean | '' |
name | name属性 | string | '' |
my-checkbox-group组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | boolean | false |
my-form组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
v-model | 双向绑定 | boolean | false |
labelWidth | label长度 | string | 空 |
my-form-item组件
参数支持
参数名称 | 参数描述 | 参数类型 | 默认值 |
---|
label | label名称 | string | false |