Skip to content

Commit dcefe74

Browse files
committed
update StaticTextField styles
1 parent 65539f0 commit dcefe74

2 files changed

Lines changed: 56 additions & 18 deletions

File tree

src/components/StaticTextField.vue

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
<template>
2-
<v-text-field
3-
:value="value"
4-
:label="label"
5-
:counter="counter"
6-
:hint="hint"
7-
:persistent-hint="persistentHint"
8-
:loading="loading"
9-
disabled
10-
class="v-static-text-field">
11-
<slot name="progress" slot="progress">
12-
<v-progress-linear :indeterminate="true" :color="progressColor" :width="progressWidth">
13-
</v-progress-linear>
14-
</slot>
15-
</v-text-field>
2+
<div>
3+
<v-text-field
4+
:value="displayText"
5+
:label="label"
6+
:counter="counter"
7+
:hint="hint"
8+
:persistent-hint="persistentHint"
9+
:loading="loading"
10+
readonly
11+
disabled
12+
class="v-static-text-field"
13+
>
14+
<template v-slot:progress>
15+
<v-progress-linear
16+
indeterminate
17+
:color="progressColor"
18+
:height="progressHeight"
19+
>
20+
</v-progress-linear>
21+
</template>
22+
</v-text-field>
23+
</div>
1624
</template>
1725

1826
<script>
@@ -23,13 +31,13 @@
2331
type: String
2432
},
2533
value: {
26-
type: String
34+
required: true
2735
},
2836
hint: {
2937
type: String
3038
},
3139
counter: {
32-
type: Number
40+
type: Boolean
3341
},
3442
persistentHint: {
3543
type: Boolean
@@ -41,10 +49,15 @@
4149
type: String,
4250
default: 'primary'
4351
},
44-
progressWidth: {
52+
progressHeight: {
4553
type: Number,
4654
default: 3
4755
}
56+
},
57+
computed: {
58+
displayText: function () {
59+
return this.loading ? '' : this.value
60+
}
4861
}
4962
}
5063
</script>

src/stylus/static-text-field.styl

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2018 Darren Fang
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*
24+
*/
25+
126
.v-static-text-field
227
input:disabled
3-
color rgba(255, 255, 255, .7)
28+
color #FFF

0 commit comments

Comments
 (0)