|
|
@@ -1,7 +1,12 @@
|
|
|
|
|
|
|
|
|
<template>
|
|
|
- <select id="gridSizeSelect" v-model="pageSize" class="pagesize-select form-control">
|
|
|
+ <select
|
|
|
+ id="gridSizeSelect"
|
|
|
+ :value="pageSize"
|
|
|
+ class="pagesize-select form-control"
|
|
|
+ @change="pageSizeChange"
|
|
|
+ >
|
|
|
<option value="10">10</option>
|
|
|
<option value="20">20</option>
|
|
|
<option value="50">50</option>
|
|
|
@@ -17,40 +22,41 @@
|
|
|
export default {
|
|
|
name: 'PageSizeSelect',
|
|
|
|
|
|
- components : {
|
|
|
-
|
|
|
- },
|
|
|
- props:{
|
|
|
- size:{
|
|
|
- type:String,
|
|
|
- default:'20',
|
|
|
+ components: {},
|
|
|
+ props: {
|
|
|
+ size: {
|
|
|
+ type: Number,
|
|
|
+ default: 20,
|
|
|
},
|
|
|
},
|
|
|
|
|
|
emits: ['pageSizeChanged'],
|
|
|
- data: function(){
|
|
|
+ data: function () {
|
|
|
return {
|
|
|
- pageSize : 20,
|
|
|
+ pageSize: 20,
|
|
|
};
|
|
|
},
|
|
|
- watch:{
|
|
|
- pageSize: function(newValue, oldValue){
|
|
|
- this.$emit('pageSizeChanged', newValue);
|
|
|
- },
|
|
|
- size: function(newValue,oldValue){
|
|
|
+ watch: {
|
|
|
+ size: function (newValue, oldValue) {
|
|
|
this.pageSize = newValue;
|
|
|
},
|
|
|
},
|
|
|
- created:function(){
|
|
|
+ created: function () {
|
|
|
this.pageSize = this.size;
|
|
|
},
|
|
|
+
|
|
|
+ methods:{
|
|
|
+ pageSizeChange: function (event) {
|
|
|
+ this.$emit('pageSizeChanged', event.target.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
- .pagesize-select{
|
|
|
- display: inline !important;
|
|
|
- width: 70px !important;
|
|
|
- float: none !important;
|
|
|
- }
|
|
|
+.pagesize-select {
|
|
|
+ display: inline !important;
|
|
|
+ width: 70px !important;
|
|
|
+ float: none !important;
|
|
|
+}
|
|
|
</style>
|