Fixed #159 - rowsPerPageOptions dropdown is not coming in Datatable

pull/201/head
cagataycivici 2020-01-30 10:37:29 +03:00
parent 246edd2f30
commit e3ea89a475
1 changed files with 31 additions and 26 deletions

View File

@ -1,30 +1,35 @@
<template>
<Dropdown :value="rows" :options="rowsOptions" optionLabel="label" optionValue="value"
@input="onChange($event)"></Dropdown>
<RPPDropdown :value="rows" :options="rowsOptions" optionLabel="label" optionValue="value"
@input="onChange($event)"></RPPDropdown>
</template>
<script>
export default {
inheritAttrs: false,
props: {
options: Array,
rows: Number
},
methods: {
onChange(value) {
this.$emit('rows-change', value);
}
},
computed: {
rowsOptions() {
let opts = [];
if (this.options) {
for(let i= 0; i < this.options.length; i++) {
opts.push({label: String(this.options[i]), value: this.options[i]})
}
}
return opts;
}
}
}
<script>
import Dropdown from '../dropdown/Dropdown';
export default {
inheritAttrs: false,
props: {
options: Array,
rows: Number
},
methods: {
onChange(value) {
this.$emit('rows-change', value);
}
},
computed: {
rowsOptions() {
let opts = [];
if (this.options) {
for(let i= 0; i < this.options.length; i++) {
opts.push({label: String(this.options[i]), value: this.options[i]})
}
}
return opts;
}
},
components: {
'RPPDropdown': Dropdown
}
}
</script>