0.0.2 • Published 2 years ago

cushui v0.0.2

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

cushui

安装组件库

1. 使用npm安装
npm install cushui

2. 使用yarn安装
yarn add cushui

3. 使用pnpm安装
pnpm install cushui

引用组件

1. 引用
import cushui from 'cushui'
import 'cushui/lib/cushui.css'
import Vue form 'vue'
Vue.use(cushui);

文档

1. 对话框

示例
<sh-dialog
    :show="true"
    title="温馨提示"
    content="这是中间显示的内容,最多3行"
    tips="内容下面提示文案"
    :onlyOneBtn="false"
    align="left"
    cancelTitle="取消"
    successTitle="确定"
    activeBtnColor="#E60027"
    @close="handleClose()"
    @confirm="handleConfirm()"
>
    <template #title>
        标题title插槽内容
    </template>
    <template #content>
        中间内容插槽内容
    </template>
    <template #button>
        底部按钮插槽内容
    </template>
</sh-dialog>
API
属性 Props
参数说明类型默认值
show是否显示弹窗Booleanfalse
title标题,可为空(无标题弹窗)String-
content内容,可识别html标签,最多三行,超过省略号显示String-
tips辅助提示String-
onlyOneBtn是否只有一个按钮,默认两个,取消和确定Booleanfalse
align内容对齐方式Stringcenter
successTitle确定按钮名称String确定
cancelTitle取消按钮名称String取消
activeBtnColor确定按钮颜色String#E60027
cancelBtnColor取消按钮颜色String#999999
事件 Event
@close
关闭弹窗时触发

@confirm
点击确定按钮时触发

@cancel
点击取消按钮时触发
插槽 Slot
1. title
标题

2. content
内容

3. button
底部按钮

2. 顶部导航栏

示例
<sh-header 
    :fixed="true" 
    title="首页" 
    right="设置"
    color="#333333"
    background="#ffffff"
    rightColor="#333333"
    @rightClick="handleRightClick"
    whiteBack
    backApp
>
    <template #left>
        返回
    </template>
    <template #title>
        导航栏标题
    </template>
    <template #right>
        导航右侧内容
    </template>
</sh-header>
API
属性 Props
参数说明类型默认值
fixed是否吸顶Booleanfalse
title标题,可为空String-
right导航栏右侧文案String-
color导航栏字体颜色String#333333
background导航栏背景颜色String#ffffff
rightColor右侧文案颜色String#333333
whiteBack是否使用白色返回图标Booleanfalse
backApp是否返回至APPBooleanfalse
事件 Event
@rightClick
右侧文案点击事件
插槽 Slot
1. left 
导航栏左侧内容

2. title
标题

3. right
导航栏右侧内容

3. 按钮

示例
<sh-button 
    @click="showDialog = true"
    fontSize="0.4rem"
    width="8.6rem"
    height="1rem"
    radius="0.2rem"
    color="red"
    border="2px solid #E60027"
    background="#ffffff"
    :disabled="false"
>按钮名称</sh-button>
API
属性 Props
参数说明类型默认值
fontSize字体大小String32px
width按钮宽度String666px
height按钮高度String80px
radius按钮圆角弧度大小String40px
color按钮名称颜色String#FFFFFF
border边框(如:2px solid #E60027)String-
background背景色(支持渐变色)Stringlinear-gradient(90deg, #FF7963 0%, #E60027 100%)
disabled是否禁用Booleanfalse
事件 Event
@click
点击按钮触发事件
插槽 Slot
1. default
按钮名称