Skip to content

Commit a8051cb

Browse files
committed
refactor: [vue2] Further fixes for v0.8
1 parent 73210c4 commit a8051cb

File tree

7 files changed

+64
-10
lines changed

7 files changed

+64
-10
lines changed

src/components/loading/Loading.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
<template>
22
<div class="quasar-loading fullscreen column items-center justify-center z-absolute">
3-
<spinner :name="spinner" color="#fff" :size="80"></spinner>
4-
<div v-if="message" style="margin: 40px 20px 0 20px; max-width: 450px; text-align: center; color: white; text-shadow: 0 0 7px black">{{ message }}</div>
3+
<spinner :name="spinner" :color="spinnerColor" :size="spinnerSize"></spinner>
4+
<div
5+
v-if="message"
6+
:style="{color: messageColor}"
7+
>{{ message }}</div>
58
</div>
69
</template>
710

811
<script>
912
export default {
1013
props: {
1114
message: [String, Boolean],
12-
spinner: String
15+
spinner: String,
16+
spinnerSize: {
17+
type: Number,
18+
default: 80
19+
},
20+
spinnerColor: {
21+
type: String,
22+
default: '#fff'
23+
},
24+
messageColor: {
25+
type: String,
26+
default: 'white'
27+
}
1328
}
1429
}
1530
</script>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
$loading-background ?= $dimmed-background
2+
13
body.with-loading
24
overflow hidden
5+
6+
.quasar-loading
7+
background $loading-background
8+
> div
9+
margin 40px 20px 0
10+
max-width 450px
11+
text-align center
12+
text-shadow 0 0 7px black

src/components/loading/loading.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { current as theme } from '../../theme'
22
import { Vue } from '../../install'
33
import Events from '../../events'
44
import Loading from './Loading.vue'
5+
import Utils from '../../utils'
56

67
let
78
vm,
@@ -16,10 +17,16 @@ function isActive () {
1617
function show ({
1718
delay = 500,
1819
spinner = theme === 'ios' ? 'ios' : 'tail',
19-
message = false
20+
message = false,
21+
spinnerSize,
22+
spinnerColor,
23+
messageColor
2024
} = {}) {
2125
props.spinner = spinner
2226
props.message = message
27+
props.spinnerSize = spinnerSize
28+
props.spinnerColor = spinnerColor
29+
props.messageColor = messageColor
2330

2431
if (appIsInProgress) {
2532
vm && vm.$forceUpdate()
@@ -31,7 +38,7 @@ function show ({
3138

3239
const node = document.createElement('div')
3340
document.body.appendChild(node)
34-
document.body.classList.add('with-loading', 'dimmed')
41+
document.body.classList.add('with-loading')
3542

3643
vm = new Vue({
3744
el: node,
@@ -54,7 +61,7 @@ function hide () {
5461
}
5562
else {
5663
vm.$destroy()
57-
document.body.classList.remove('with-loading', 'dimmed')
64+
document.body.classList.remove('with-loading')
5865
document.body.removeChild(vm.$el)
5966
vm = null
6067
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1+
$loading-background ?= $dimmed-background
2+
13
body.with-loading
24
overflow hidden
5+
6+
.quasar-loading
7+
background $loading-background
8+
> div
9+
margin 40px 20px 0
10+
max-width 450px
11+
text-align center
12+
text-shadow 0 0 7px black
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
<template>
2-
<div class="item item-link drawer-closer">
2+
<router-link
3+
:to="to"
4+
:replace="replace"
5+
:append="append"
6+
:exact="exact"
7+
tag="div"
8+
class="item item-link drawer-closer"
9+
>
310
<i v-if="icon" class="item-primary">{{icon}}</i>
411
<div class="item-content">
512
<slot></slot>
613
</div>
7-
</div>
14+
</router-link>
815
</template>
916

1017
<script>
1118
export default {
12-
props: ['icon']
19+
props: ['icon', 'to', 'replace', 'append', 'exact']
1320
}
1421
</script>

src/vue-components/tab/Tab.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export default {
5050
created () {
5151
if (this.route) {
5252
this.$watch('$route', () => {
53-
this.__selectTabIfRouteMatches()
53+
this.$nextTick(() => {
54+
this.__selectTabIfRouteMatches()
55+
})
5456
})
5557
}
5658
},

src/vue-components/tab/Tabs.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ export default {
124124
this.setActiveTab(this.defaultTab)
125125
this.__findTabAndScroll(this.defaultTab)
126126
}
127+
else {
128+
this.__findTabAndScroll(this.activeTab)
129+
}
127130
})
128131
},
129132
beforeDestroy () {

0 commit comments

Comments
 (0)