grid component used for pc
# install grid component
npm install vue-selects --save
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
<template>
<div id="app">
<selects
:selects-list="selects.selectsList"
:default-obj="selects.defaultObj"
:on-choice="choice"
>
</selects>
</div>
</template>
<script>
import selects from 'components/'
export default {
components: {
selects,
},
data () {
return {
selects2: {
selectsList: [{
text: 'whole',
id: '0'
},{
text: 'selects1',
id: '1'
}],
defaultObj: {
text: 'selects4',
id: '1'
}
}
}
},
methods: {
choice(item){
console.log(item);
}
}
}
</script>
- 属性说明
属性 | 说明 | 类型 | 默认值 | 是否必传 |
---|---|---|---|---|
selects-list | data list | Function | - | 否 |
default-obj | default value, it will be showed | Object | - | 否 |
on-choice | the callback function, when choice one item | Function | - | 否 |
- 基本功能实现