1.0.15 • Published 2 years ago

zznode-common v1.0.15

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

zznode-common

一、 安装与使用

yarn add zznode-common --save

如果要删除模块
yarn remove zznode-common

1 全局引入 zznode-common

在入口 main.js 中

import Vue from 'vue'
import ZznodeCommon from 'zznode-common'
Vue.use(ZznodeCommon)

后续组件可以直接如下使用,而不用在当前 vue 组件中进行 import 然后注册

<button-add></button-add>

2 局部按需引入单个组件

<button-add></button-add>
...

import {ButtonAdd} from "zznode-common"
export default {
	components: {ButtonAdd}
}

3 自定义指令

拖动 v-el-drag-dialog

<el-dialog v-el-drag-dialog :visible.sync="dialogTableVisible" title="Shipping address"></el-dialog>

按钮效果 v-waves

<el-button v-waves class="filter-item" type="primary" icon="el-icon-search">
Search
</el-button>

复制文字/提示文字复制成功 v-clipboard

<el-input v-model="inputData" placeholder="Please input" style="width:400px;max-width:100%;" />
<el-button v-clipboard:copy="inputData" v-clipboard:success="clipboardSuccess" type="primary" icon="el-icon-document">
  copy
</el-button>

组件 api 说明文档

1 基础扩展组件

按钮

/* 添加 */
<button-add />
/* 取消 */
<button-cancel />
/* 删除 */
<button-delete />
/* 编辑 */
<button-edit />
/* 保存 */
<button-save />
/* 查询 */
<button-search />

分页组件

<ZzPagination />

以下列出了拓展的属性说明

props

参数说明类型默认值
total总条目数Number-
page当前选择的页码Number1
limit每页条数显示条数Number20
pageSizes每页显示个数选择器的选项设置Array10, 20, 30, 50
layout表示需要显示的内容,用逗号分隔,布局元素会依次显示。prev 表示上一页,next 为下一页,pager 表示页码列表,除此以外还提供了 jumper 和 total,size 和特殊的布局符号->,->后的元素会靠右显示,jumper 表示跳页元素,total 表示总条目数,size 用于设置每页显示的页码数量String"total, sizes, prev, pager, next, jumper"
background为分页按钮添加背景色Booleantrue
autoScroll翻页是是否回到顶部Booleantrue
hidden是否不显示Booleanfalse

events

方法名说明参数参数说明
pagination获取当前页及当前页的条数(page, limit) page 当前页 limit 当前页条数-

methods

方法名说明参数参数说明
handleSizeChangepageSize 改变时会触发(pageSize)切换条数-
handleCurrentChangecurrentPage 改变时会触发(current)当前页修改时触发-

table 组件

<ZzTable />

以下列出了拓展的属性说明

参数说明类型默认值
tableDatatable 数据Array[]
rowDblclick单行点击事件Function(row, event, column) => {console.log('default: ' + row + '---' + event + '---' + column)}
tableHeader表格头部Array[]
tabHeight表格高度String'100%'
loading加载等待Booleanfalse
isShow是否需要选择Booleanfalse

events

方法名说明参数参数说明
func获取选择行数信息[]-

json 编辑器

<json-editor ref="jsonEditor" v-model="value" />

可拖动列表

<Kanban :key="1" :list="list1" :group="group" class="kanban todo" header-text="Todo" />
<Kanban :key="2" :list="list2" :group="group" class="kanban working" header-text="Working" />

以下列出了拓展的属性说明(group 是应用在 vuedraggable 中)

props

参数说明类型默认值
headerText标题名称String'Header'
options选择项Object{}
list列表数据Array[]

固定位置标签

<sticky :sticky-top="200">
  <el-button type="primary"> placeholder</el-button>
</sticky>

以下列出了拓展的属性说明

props

参数说明类型默认值
stickyTop固定位置Number0
zIndex设置层级Number1
className设置类名String''

返回顶部

<el-tooltip placement="top" content="tooltip">
  <back-to-top :custom-style="myBackToTopStyle" :visibility-height="300" :back-position="50" transition-name="fade" />
</el-tooltip>
参数说明类型默认值
visibilityHeight滚动多少距离显示Number400
backPosition返回到顶部的距离Number0
customStyle小图标的样式Object{right: '50px',bottom: '50px',width: '40px',height: '40px','border-radius': '4px','line-height': '45px', background: '#e7eaf1'}
transitionName动画名称String'fade'

input 详情展示

<only-detail :descList="descList" :desProps="desProps"></only-detail>

具体示例可参考 test.vue

参数说明类型默认值
descList需要展示的数组Array[]
desProps扩展的传输值Object{ column: 2}

table 输入框展示

<input-table :tableData="tableData" :listCount="listCount" :propList="propList" :page.sync="pageInfo"></input-table>

具体示例可参考 test.vue

参数说明类型默认值
tableData需要展示的数据Array[]
propListth 展示的内容以及是否使用插槽Array[]
listCount树图的总数Number0
page当前展示的页数以及当前页展示个数Object{ currentPage: 1, pageSize: 10 }
1.0.15

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago