A list panel component for Vue.js 2.0
- Vue.js 2.x
- Less
npm i @hyjiacan/vue-listpanel
or
yarn add @hyjiacan/vue-listpanel
For the latest code, you can:
git clone https://github.com/hyjiacan/vue-listpanel.git
main.js
import Vue from 'vue'
import ListPanel from '@hyjiacan/vue-listpanel'
import '@hyjiacan/vue-listpanel/lib/listpanel.css'
// import ListPanel component, and set the defaults props
Vue.use(ListPanel, {
// set props here
})
Foobar.vue
<list-panel :selected="[]">
<list-panel-item :value="1">Content</list-panel-item>
<list-panel-item :value="1">
<template v-slot="{value, selected}">
value: {{value}}, selected: {{selected}}
</template>
</list-panel-item>
</list-panel>
<script>
import ListPanel from '@hyjiacan/vue-listpanel'
import '@hyjiacan/vue-listpanel/lib/listpanel.css'
export default {
name: 'Foobar',
components: {ListPanel}
}
</script>
For more usage, see https://hyjiacan.github.io/vue-listpanel/
- type
String
Title text, if this property and the slot
header
are empty, header would be hidden
- type
Boolean
- default
false
Whether to collapse panel content
- type
Boolean
- default
true
Is the collapse button visible
- type
Boolean
- default
false
Whether to hide
footer
while collapsed
- type `Boolean'
- default
true
Is the header visible
- type `Boolean'
- default
false
Whether to enable multi-selection
- type `String/Number/Array/Object'
Specify the selected items, modifier
.sync
is available
- type `String'
Customize class name
- type `Boolean'
- default
false
Is list
readonly
, iftrue
, cannot toggle selected by mouse-click
- type `Boolean'
- default
false
Whether to make it in
inline
mode (Display multiple items in one line)
- type `Function'
Is two value equals,useful while the
value
property isObject
List items
The header content,property
title
would be ignored
Footer content
- args While
multi=true
:[selected]
,item is a selected value; otherwiseselected
- type
String/Number/Object/
The value of this item
- type
Boolean
- default
false
Is this item selected
- type
Boolean
- default
false
Whether to ignore click event on this item
- args
{selected, value}
,selected
is this item selected,value
the value of this item
Contents of this item
yarn
# start dev server
yarn serve
# Build library
yarn release