free-fe-core-modules 0.0.27 → 0.0.29

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.
@@ -49,7 +49,7 @@ export function useObjectData(props, ctx) {
49
49
  if (typeof getData === 'function') {
50
50
  Promise.resolve(getData(...args)).then((d) => {
51
51
  if (hasMultipleGetData) {
52
- Object.assign(data.value, unref(d[0]));
52
+ Object.assign(data.value, unref(d));
53
53
  } else {
54
54
  data.value = unref(d);
55
55
  }
@@ -58,7 +58,7 @@ export function useObjectData(props, ctx) {
58
58
  });
59
59
  } else {
60
60
  if (hasMultipleGetData) {
61
- Object.assign(data.value, unref(getData[0]));
61
+ Object.assign(data.value, unref(getData));
62
62
  } else {
63
63
  data.value = unref(getData);
64
64
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
-
1
+ import { getCurrentInstance } from 'vue';
2
2
  import { date as quasarDate } from 'quasar';
3
3
  import config from '@/config';
4
4
  import useAppStore from '@/stores/app';
@@ -132,36 +132,37 @@ const filters = {
132
132
  ago: (d) => {
133
133
  const date1 = new Date();
134
134
  const date2 = new Date(d);
135
+ const { proxy:vm } = getCurrentInstance();
135
136
 
136
137
  let diff = quasarDate.getDateDiff(date1, date2, 'seconds');
137
138
  if (diff < 1) {
138
- return diff + Vue.prototype.$t('justNow');
139
+ return diff + vm.$t('justNow');
139
140
  }
140
141
  if (diff < 60) {
141
- return diff + Vue.prototype.$t('secondsAgo');
142
+ return diff + vm.$t('secondsAgo');
142
143
  }
143
144
 
144
145
  diff = quasarDate.getDateDiff(date1, date2, 'minutes');
145
146
  if (diff < 60) {
146
- return diff + Vue.prototype.$t('minutesAgo');
147
+ return diff + vm.$t('minutesAgo');
147
148
  }
148
149
 
149
150
  if (diff < 24) {
150
- return diff + Vue.prototype.$t('hoursAgo');
151
+ return diff + vm.$t('hoursAgo');
151
152
  }
152
153
 
153
154
  diff = quasarDate.getDateDiff(date1, date2, 'days');
154
155
  if (diff < 31) {
155
- return diff + Vue.prototype.$t('daysAgo');
156
+ return diff + vm.$t('daysAgo');
156
157
  }
157
158
 
158
159
  diff = quasarDate.getDateDiff(date1, date2, 'months');
159
160
  if (diff < 13) {
160
- return diff + Vue.prototype.$t('monthsAgo');
161
+ return diff + vm.$t('monthsAgo');
161
162
  }
162
163
 
163
164
  diff = quasarDate.getDateDiff(date1, date2, 'years');
164
- return diff + Vue.prototype.$t('yearsAgo');
165
+ return diff + vm.$t('yearsAgo');
165
166
  },
166
167
  stepCaption: (step, status, data) => {
167
168
  if (!step) return '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-fe-core-modules",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/freeeis/free-fe-core-modules.git",
6
6
  "author": "zhiquan",