@live-change/vue3-components 0.8.59 → 0.8.60
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/logic/Loading.vue +5 -5
- package/logic/LoadingZone.vue +5 -5
- package/package.json +3 -3
package/logic/Loading.vue
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<slot v-if="state
|
|
3
|
-
<slot v-if="state
|
|
2
|
+
<slot v-if="state === 'ready'" :value="what"></slot>
|
|
3
|
+
<slot v-if="state === 'error'" name="error">
|
|
4
4
|
<div class="alert alert-danger" role="alert">error</div>
|
|
5
5
|
</slot>
|
|
6
|
-
<slot v-if="state
|
|
6
|
+
<slot v-if="state === 'loading'" name="loading">
|
|
7
7
|
</slot>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
watch: {
|
|
35
35
|
loaded(def) {
|
|
36
|
-
if(def && this.state
|
|
36
|
+
if(def && this.state === 'loading') {
|
|
37
37
|
this.state = 'ready'
|
|
38
38
|
if(this.loadingTask) {
|
|
39
39
|
this.loadingZone.finished(this.loadingTask)
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
error(error) {
|
|
45
|
-
if(error && this.state
|
|
45
|
+
if(error && this.state === 'loading') {
|
|
46
46
|
this.state = 'error'
|
|
47
47
|
if(this.loadingTask) {
|
|
48
48
|
this.loadingZone.failed(this.loadingTask, error)
|
package/logic/LoadingZone.vue
CHANGED
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
},
|
|
76
76
|
methods: {
|
|
77
77
|
loadingStarted(task) {
|
|
78
|
-
if(this.loading.length
|
|
78
|
+
if(this.loading.length === 0) {
|
|
79
79
|
analytics.emit('loadingStarted', { task: task.name })
|
|
80
80
|
info('LOADING STARTED!')
|
|
81
81
|
|
|
82
82
|
const loadingBlockId = this.loadingBlockId
|
|
83
83
|
this.loadingTimeout = setTimeout(() => {
|
|
84
|
-
if(loadingBlockId
|
|
84
|
+
if(loadingBlockId === this.loadingBlockId && this.loading.length > 0) {
|
|
85
85
|
this.connectionProblem = true
|
|
86
86
|
analytics.emit('loadingError', {
|
|
87
87
|
task: 'View loading', reason: "connection problem",
|
|
@@ -98,12 +98,12 @@
|
|
|
98
98
|
loadingFinished(task) {
|
|
99
99
|
let id = this.loading.indexOf(task)
|
|
100
100
|
debug(`task finished ${task.name}`)
|
|
101
|
-
if(id
|
|
101
|
+
if(id === -1) throw new Error("Task not found")
|
|
102
102
|
this.loading.splice(id, 1)
|
|
103
103
|
|
|
104
104
|
if(this.$allLoadingTasks)
|
|
105
105
|
this.$allLoadingTasks.splice(this.$allLoadingTasks.indexOf(task), 1)
|
|
106
|
-
if(this.loading.length
|
|
106
|
+
if(this.loading.length === 0) {
|
|
107
107
|
this.loadingBlockId++
|
|
108
108
|
clearTimeout(this.loadingTimeout)
|
|
109
109
|
analytics.emit('loadingDone', { task: task.name })
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
this.errors.push({ task, reason })
|
|
119
119
|
analytics.emit('loadingError', { task: task.name, reason })
|
|
120
120
|
let id = this.loading.indexOf(task)
|
|
121
|
-
if(id
|
|
121
|
+
if(id === -1) {
|
|
122
122
|
this.errors.push({ task, reason: "unknown task "+task.name })
|
|
123
123
|
throw new Error("Task not found")
|
|
124
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/vue3-components",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.60",
|
|
4
4
|
"description": "Live Change Framework - vue components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-stack",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/vue3-ssr": "^0.8.
|
|
24
|
+
"@live-change/vue3-ssr": "^0.8.60",
|
|
25
25
|
"debug": "^4.3.4",
|
|
26
26
|
"mitt": "3.0.1",
|
|
27
27
|
"vue": "^3.4.29"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "88bd85bdcd412560abb0aa13f9f3e9c30cbc5455"
|
|
30
30
|
}
|