gyyg-components 0.2.19 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gyyg-components",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -77,10 +77,21 @@ export default {
77
77
  },
78
78
  options: {
79
79
  handler: function (val) {
80
- //判断options是否为promise
81
- if (typeof val !== 'function' && val && !val.then) {
82
- this.option = this.options;
83
- }
80
+ if (!Array.isArray(this.options) && this.options) {
81
+ if(this.options instanceof Promise) {
82
+ this.options.then(val => {
83
+ this.option = val.data || val;
84
+ });
85
+ }
86
+ if(typeof this.options == 'function') {
87
+ this.options().then(val => {
88
+ this.option = val.data || val;
89
+ });
90
+ }
91
+
92
+ } else {
93
+ this.option = this.options;
94
+ }
84
95
  },
85
96
  deep: true,
86
97
  immediate: true,
@@ -98,23 +109,6 @@ export default {
98
109
  this.$emit('clear')
99
110
  }
100
111
  },
101
- mounted() {
102
- if (!Array.isArray(this.options) && this.options) {
103
- if(this.options instanceof Promise) {
104
- this.options.then(val => {
105
- this.option = val.data || val;
106
- });
107
- }
108
- if(typeof this.options == 'function') {
109
- this.options().then(val => {
110
- this.option = val.data || val;
111
- });
112
- }
113
-
114
- } else {
115
- this.option = this.options;
116
- }
117
- }
118
112
  };
119
113
  </script>
120
114
 
@@ -86,9 +86,8 @@
86
86
 
87
87
  </el-table>
88
88
  <!-- 分页 -->
89
- <div class="pagination-layout">
89
+ <div class="pagination-layout" v-if="page">
90
90
  <el-pagination
91
- v-if="page"
92
91
  @size-change="handleSizeChange"
93
92
  @current-change="handleCurrentChange"
94
93
  :page-sizes="[10, 20, 30, 50]"