0.2.5 • Published 2 years ago

david-elements v0.2.5

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

david-elements v0.2.4


A UI plug-in library based on Vue secondary encapsulation is based on elementui

Installation


Using npm: Inline npm i --save david-elements


Use In Vue Application

Global import main.js

    import DavidElements from 'david-elements'
    import 'david-elements/lib/david-element.css'
    Vue.use(DavidElements)

Load components on demand main.js

import DavidElements from 'david-elements'
import 'david-elements/lib/david-element.css'
const { DvTable, DvForm, DvCropper, DvDialog, DvTransfer, DvUpload } = DavidElements;
Vue.use(DvTable)
Vue.use(DvForm)
Vue.use(DvCropper)
Vue.use(DvDialog)
Vue.use(DvTransfer)
Vue.use(DvUpload)

example: HelloWorld.vue

<template>
  <div>
    <dv-table></dv-table>
    <dv-form></dv-form>
    <dv-cropper></dv-cropper>
    <dv-dialog></dv-dialog>
    <dv-transfer></dv-transfer>
    <dv-upload></dv-upload>
  </div>
</template>

Documents

params and method config in component

  • DvTable

Attributes

AttributeDescriptionTypeAccepted ValuesDefault
tableDataTable dataarray--
tableOptionstable configObjecttableOptions{}
columnstable column fieldarray--columns
columnsOptionscolumns configObjectcolumnsOptions{}
isRadiotable radioboolean--false
isPaginationshow the paginationboolean--true
totaltotal of tableData numsNumber--0
pageSizethe pagination set size for pageNumNumber--10
currentPagethe current page in paginationNumber--1
ClickCurrentChangewhen the radio row clickFunction@ClickCurrentChange=(row)=>{}--
currentChangepagination clickFunction@currentChange=(page) => {}--
selectionChangewhen the table isSelect, select datasFunction@selectionChange=(datas) => {}--
clearSelectionclear select in tableref functionthis.$refs.table.clearSelection()--
previewwhen the table column type is Imgref function----
setRowSelectionset the selected data in tableref functionthis.$refs.table.setRowSelection(selectedDatas)--

tableOptions

  • height: Number
  • border: Boolean
  • isSelection: Boolean
  • showSelect: Function
  • isIndex: Boolean
  • indexMethod: Function

columns: Array

columnsOptions

  • align: Boolean

  • DvForm
  • DvCropper
  • DvDialog
  • DvTransfer
  • DvTransfer
  • DvUpload

Warning: do not use during the test phase