@afeefa/vue-app 0.0.265 → 0.0.267
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.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.267
|
package/package.json
CHANGED
package/src/components/ATabs.vue
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
import { Component, Vue } from '@a-vue'
|
34
34
|
|
35
35
|
@Component({
|
36
|
-
props: [{first: false}]
|
36
|
+
props: ['beforeChange', {first: false}]
|
37
37
|
})
|
38
38
|
export default class ATabs extends Vue {
|
39
39
|
titles = []
|
@@ -47,7 +47,14 @@ export default class ATabs extends Vue {
|
|
47
47
|
this.$children[this.currentIndex].show()
|
48
48
|
}
|
49
49
|
|
50
|
-
setTab (index) {
|
50
|
+
async setTab (index) {
|
51
|
+
if (this.beforeChange) {
|
52
|
+
const result = await this.beforeChange(index, this.currentIndex)
|
53
|
+
if (!result) {
|
54
|
+
return
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
51
58
|
this.currentIndex = index
|
52
59
|
const tabs = this.$slots.default.map(s => s.componentInstance)
|
53
60
|
tabs.forEach((tab, i) => {
|
@@ -98,7 +98,16 @@ export class ListViewMixin extends Vue {
|
|
98
98
|
}
|
99
99
|
|
100
100
|
@Watch('listAction')
|
101
|
-
listActionChanged () {
|
101
|
+
listActionChanged (newAction, oldAction) {
|
102
|
+
// es gibt den fall, dass diese liste in einer detailansicht steckt
|
103
|
+
// und dort der owner nach dem speichern aktualisiert wird, dann ändert sich auch
|
104
|
+
// die listAction, aber die filter sind alle gleich. dann wollen wir nicht
|
105
|
+
// neu laden
|
106
|
+
newAction = JSON.stringify(newAction.getApiRequest().serialize())
|
107
|
+
oldAction = JSON.stringify(oldAction.getApiRequest().serialize())
|
108
|
+
if (newAction === oldAction) {
|
109
|
+
return
|
110
|
+
}
|
102
111
|
this.init()
|
103
112
|
}
|
104
113
|
|
@@ -159,7 +159,6 @@
|
|
159
159
|
<script>
|
160
160
|
import { Component, Watch, Mixins } from '@a-vue'
|
161
161
|
import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
|
162
|
-
import { LoadingEvent } from '@a-vue/events'
|
163
162
|
|
164
163
|
@Component({
|
165
164
|
props: [
|
@@ -235,13 +234,6 @@ export default class ListView extends Mixins(ListViewMixin) {
|
|
235
234
|
|
236
235
|
@Watch('isLoading')
|
237
236
|
isLoadingChanged () {
|
238
|
-
if (this.events) {
|
239
|
-
if (this.isLoading) {
|
240
|
-
this.$events.dispatch(new LoadingEvent(LoadingEvent.START_LOADING))
|
241
|
-
} else {
|
242
|
-
this.$events.dispatch(new LoadingEvent(LoadingEvent.STOP_LOADING))
|
243
|
-
}
|
244
|
-
}
|
245
237
|
this.$emit('update:isLoading', this.isLoading)
|
246
238
|
}
|
247
239
|
|