0.2.0 • Published 3 years ago

luckyzhou-ui v0.2.0

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

lucky-ui

1. 安装
npm install lucky-wen-ui
2. 使用
import LuckyUI from 'lucky-wen-ui'
import 'luckyzhou-ui/dist/luckyzhou-ui.css'
Vue.use(LuckyUI)

1.1 button按钮

1.1.1 参数支持

参数名参数描述参数类型默认值
type按钮类型(primary / success / danger)stringdefault
plain是否是朴素按钮booleanfalse
round是否是圆角按钮booleanfalse
circle是否是圆形按钮booleanfalse
disabled是否禁用按钮booleanfalse
icon图标类名string

1.1.2 事件支持

事件名事件描述
click点击事件

1.1.3 代码

<lu-button type="primary">主要按钮</lu-button>
<lu-button type="primary" plain>主要按钮</lu-button>
<lu-button type="primary" round>主要按钮</lu-button>
<lu-button type="primary" circle plain>拆</lu-button>
<lu-button circle icon="lu-icon-home"></lu-button>
<lu-button disabled>默认</lu-button>

1.2 dialog模态框

1.2.1 参数支持

参数名参数描述参数类型默认值
title对话框标题string提示
width宽度string50%
top与顶部距离string15vh
visible是否显示dialog(支持sync修饰符)booleanfalse

1.2.2 事件支持

事件名事件描述
opened模态框显示的事件
closed模态框关闭的事件

1.2.3 插槽说明

插槽名称插槽描述
defaultdialog的内容
titledialog的标题
footerdialog的底部操作区

1.2.4 代码

        <lu-button type="primary" @click="visible = true">点击弹出dialog</lu-button>
        <lu-dialog title="我是一个标题" top="100px" width="50%" :visible="visible" @close="close">
            <ul>
                <li>我是内容</li>
                <li>我也是内容</li>
            </ul>
            <template v-slot:footer>
                <lu-button @click="visible = false">取消</lu-button>
                <lu-button type="primary" @click="visible = false">确定</lu-button>
            </template>
        </lu-dialog>

        data() {
            return {
                visible: false,
            }
        }

1.3 result结果

1.3.1 参数支持

参数名参数描述参数类型默认值
title标题string提示
sub-title二级标题string请根据提示进行操作
type图标类型(success / warning / info / error)stringinfo
icon图标stringlu-icon-info

1.3.2 插槽说明

插槽名称插槽描述
icon自定义图标
title自定义标题
subTitle自定义二级标题
extra自定义底部额外区域

1.3.3 代码

<lu-result title="成功提示" type="success" icon="lu-icon-checkbox-checked">
    <template v-slot:extra>
    	<lu-button>返回</lu-button>
    </template>
</lu-result>

1.4 input输入框

1.4.1 参数支持

参数名参数描述参数类型默认值
placeholder占位符string
type文本框类型(text / password)stringtext
disabled禁用booleanfalse
clearable是否显示清空按钮booleanfalse
show-password是否显示密码切换按钮booleanfalse
namename属性string

1.4.2 事件支持

事件名事件描述
blur失去焦点
change内容改变
focus获得焦点

1.4.3 代码

<lu-input placeholder="占位符" :disabled="true"></lu-input>
<lu-input v-model="username" show-password></lu-input>
<lu-input clearable v-model="username"></lu-input>

1.5 switch开关

1.5.1 参数支持

参数名称参数描述参数类型默认值
v-model双向数据绑定booleanfalse
namename属性stringtext
activeColor自定义激活的颜色string
inactiveColor自定义不激活的颜色string

1.5.2 事件支持

事件名事件描述
change状态改变

1.5.3 代码

<lu-switch v-model="Toggle" name="status" active-color="red" inactive-color="pink"></lu-switch>

1.6 radio单选框

1.6.1 参数支持

参数名称参数描述参数类型默认值
namename属性string
labelradio 的 valuestring / number / boolean
v-model双向数据绑定

1.6.2 插槽说明

插槽名称插槽描述
default文字

1.6.3 代码

<lu-radio name="sex" label="1" v-model="sex">男</lu-radio>
<lu-radio name="sex" label="0" v-model="sex">女</lu-radio>

1.7 radio-group 单选框组

1.7.1 参数说明

参数名称参数描述参数类型默认值
v-model双向数据绑定string / number / boolean

1.7.2 代码

<lu-radio-group v-model="sex">
    <lu-radio label="1">男</lu-radio>
    <lu-radio label="0">女</lu-radio>
</lu-radio-group>

1.8 checkbox 复选框

1.8.1 参数

更多操作参数名称参数描述参数类型默认值
namename属性string
labelcheckbox 的 valuestring / number / boolean
v-model双向数据绑定

1.8.2 插槽说明

插槽名称插槽描述
default描述

1.8.3 代码

<lu-checkbox v-model="active">是否选中</lu-checkbox>
<lu-checkbox v-model="active" name="lan" label="篮球"></lu-checkbox>

1.9 checkbox-group 复选框组

1.9.1 参数说明

参数名称参数描述参数类型默认值
v-model双向数据绑定

1.9.2 代码

<lu-checkbox-group v-model="arr">
    <lu-checkbox label="pink"></lu-checkbox>
    <lu-checkbox label="green"></lu-checkbox>
    <lu-checkbox label="red"></lu-checkbox>
</lu-checkbox-group>

2.0 form 表单

2.0.1 参数说明

参数名称参数描述参数类型默认值
model表单数据对象object{}
label-widthlabel的宽度String80px

2.0.2 插槽说明

插槽名称插槽描述
default表单元素

2.0.3 代码

<lu-form :model="form" label-width="100px">
	
</lu-form>

2.1 form-item 表单域

2.1.1 参数说明

参数名称参数描述参数类型默认值
label文字描述String

2.1.2 插槽说明

插槽名称插槽描述
default表单元素

2.1.3 代码

    <lu-form :model="form" label-width="100px">
      <lu-form-item label="用户名">
        <lu-input placeholder="请输入用户名" v-model="form.username"></lu-input>
      </lu-form-item>
      <lu-form-item label="开关">
        <lu-switch v-model="form.active"></lu-switch>
      </lu-form-item>
    </lu-form>

2.2 message 提示框

2.2.1 参数说明

参数名称参数描述参数类型默认值
message文本String这是一条消息提示
type类型(success / warning / info / error)stringinfo
icon图标stringlu-icon-infofill

2.2.2 代码

Click() {
      this.$message({
        message: '这是文本信息',
        type: 'warning',
        icon: 'lu-icon-time'
      })
    }

2.3 backtop 返回顶部

2.3.1 参数说明

参数名称参数描述参数类型默认值
visibility-height滚动高度达到此参数值才出现string/number200
right控制其显示位置, 距离页面右边距string/number40
bottom控制其显示位置, 距离页面底部距离string/number40
icon图标stringlu-icon-arrow_up_fill

2.3.2 代码

<lu-backtop visibility-height="300" right="100" bottom="100" icon="lu-icon-oppose_fill_light"></lu-backtop>
0.2.0

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago