0.1.12 • Published 4 years ago

rz-el-comp v0.1.12

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

rz-comp

A components group base on element-ui


Component Install

Should import Element first.
You can import the Element entirely or import the components that mentions below on demand.

npm install rz-comp -S

Component Details

rz-sidebar

Element Requirements:

  • Menu
  • MenuItem
  • Submenu
  • Tooltip (while attribute collapse is true)
<rz-sidebar
  :list="List"
  :config="Config"/>
Attributes
AttributeDescriptionTypeAccepted ValuesDefault
configcomponents configObject--
listitem listArray--
Object Config Attributes
AttributeDescriptionTypeAccepted ValuesDefault
collapsewhether the menu is collapsedBoolean-false
defaultActivethe index of menu in ListString--
defaultOpenAllwhether open all the sub-menusBoolean-true
Array List Structure
List: [
  {
    label: 'aa',
    isLeaf: true,
    icon: 'el-icon-plus',
    callback() {
    }
  },
  {
    label: 'bb',
    isLeaf: false,
    leafList: [
      {
        label: 'bb-1', icon: 'el-icon-minus', callback() {
        }
      },
      {
        label: 'bb-2', callback() {
        }
      },
    ],
    icon: 'el-icon-location'
  }
]
Object the item of List Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
isLeafwhether the menu node has no submenuBoolean-true
iconthe name of iconString--
leafListsubmenu list while isLeaf is falseArraysee the item attributes below-
callbackthe method when menu is clickedFunction--
Object the item of leafList Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
iconthe name of iconString--
callbackthe method when menu is clickedFunction--

rz-query-bar

Element Requirements:

  • Button
  • Input (while attribute type = 'text')
  • DatePicker (while attribute type = 'date' or 'date-range')
  • Select (while attribute type = 'select')
  • Option (while attribute type = 'select')
<rz-query-bar
  :button-group="buttonGroup"
  :list="List"
  :data.sync="Data"/>
Attributes
AttributeDescriptionTypeAccepted ValuesDefault
buttonGroupoperation button groupArray--
listitem listArray--
databinding valueObject{}-
Array List Structure
List: [
  {
    type: 'text', 
    label: 'aa',
    size: 'small',
    prop: 'a',
    clearable: false,
  },
  {
    type: 'date',
    label: 'bb',
    size: 'small',
    prop: 'b',
  },
  {
    type: 'date-range',
    label: 'cc',
    size: 'small',
    pickerList: [
      {
        label: 'Latest Month',
        duringTime: 3600 * 24 * 1000 * 30,
      }
    ],
    prop: 'c',
  },
  {
    type: 'select',
    label: 'dd',
    size: 'small',
    selectList: [
      {key: 0, label: '0'},
      {key: 1, label: '1'},
      {key: 2, label: '2'},
    ], 
    prop: 'd',
  }
]
Object the item of List Attributes
AttributeDescriptionTypeAccepted ValuesDefault
type(required) the type of itemStringtext / date / select / date-range-
prop(required) the data key name of itemString--
labellabel textString--
sizesize of itemStringsmall / mini / undefined-
clearablewhether component provides a clear buttonBoolean-true
pickerListthe date picker config when type = 'date-range'Arraysee the item attributes below-
selectListthe options list when type = 'select'Arraysee the item attributes below-
Object the item of pickerList Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
duringTimethe time before now (unit: ms)Number--
Object the item of selectList Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
keyoption key nameString--
Array buttonGroup Structure
buttonGroup: [
  {
    label: 'Search',
    size: 'small',
    type: 'primary',
    callback() {
    }
  },
  {
    label: 'Delete',
    size: 'small',
    callback() {

    }
  }
],
Object the item of buttonGroup Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
sizesize of itemStringsmall / mini / undefined-
typeElement Button typeStringprimary / success / warning / danger / info / text-
callbackthe method when button is clickedFunction--

rz-form-item

Element Requirements:

  • Button
  • Input (while attribute type = 'text')
  • DatePicker (while attribute type = 'date' or 'date-range')
  • Select (while attribute type = 'select')
  • Option (while attribute type = 'select')
  • Switch (while attribute type = 'switch')
<rz-form-item
    :config="Config"
    :list="List"
    :rules="Rules"
    :data.sync="Data"/>
Attributes
AttributeDescriptionTypeAccepted ValuesDefault
configcomponents configObject--
listitem listArray--
rulesElement Form rulesObject--
databinding valueObject{}-
Object Config Attributes
AttributeDescriptionTypeAccepted ValuesDefault
refNameref name of the formString--
sizesize of itemStringsmall / mini / undefined-
identityform items id prefix. Shouldn't be same as other rz-form-itemString--
Array List Structure
List: [
  {type: 'text', label: 'aa', prop: 'a', clearable: false, limit: [0, 10]},
  {type: 'date', label: 'bb', prop: 'b'},
  {
    type: 'select',
    label: 'cc',
    prop: 'c',
    selectList: [
      {key: 0, label: '0'},
      {key: 1, label: '1'},
    ]
  },
  {type: 'switch', label: 'ee', prop: 'e'},
  {type: 'text', inputType: 'textarea', rows: 5,  label: 'dd', prop: 'd'},
],
Object the item of List Attributes
AttributeDescriptionTypeAccepted ValuesDefault
type(required) the type of itemStringtext / date / select / switch / date-range-
prop(required) the data key name of itemString--
labellabel textString--
sizesize of itemStringsmall / mini / undefined-
clearablewhether component provides a clear buttonBoolean-true
limittext string length limit. When type = 'text'Array(2)min, max-
pickerListthe date picker config when type = 'date-range'Arraysee the item attributes below-
selectListthe options list when type = 'select'Arraysee the item attributes below-
inputTypetype of input. When type = 'text'Stringtextarea / undefined-
rowsnumbers of text area rows. When inputType = 'textarea'Number-3
Object the item of pickerList Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
duringTimethe time before now (unit: ms)Number--
Object the item of selectList Attributes
AttributeDescriptionTypeAccepted ValuesDefault
labellabel textString--
keyoption key nameString--
0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago