This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-47
lines changed
components/linear-progress Expand file tree Collapse file tree 3 files changed +23
-47
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ export default {
23
23
props: {
24
24
open: {
25
25
type: Boolean ,
26
- required : false
26
+ default : false
27
27
},
28
28
indeterminate: {
29
29
type: Boolean ,
30
- required : false
30
+ default : false
31
31
},
32
32
reverse: {
33
33
type: Boolean ,
34
- required : false
34
+ default : false
35
35
},
36
36
progress: {
37
37
type: Number ,
@@ -76,14 +76,6 @@ export default {
76
76
},
77
77
beforeDestroy () {
78
78
this .mdcLinearProgress .destroy ()
79
- },
80
- methods: {
81
- show () {
82
- this .mdcLinearProgress .open ()
83
- },
84
- hide () {
85
- this .mdcLinearProgress .close ()
86
- }
87
79
}
88
80
}
89
81
</script >
Original file line number Diff line number Diff line change 3
3
### Markup
4
4
5
5
``` html
6
- <m-linear-progress ref =" progress" open :progress =" 0.5" :buffer =" 0.5" indeterminate />
6
+ <m-linear-progress
7
+ :open =" isProgressOpen"
8
+ :progress =" 0.5"
9
+ :buffer =" 0.5"
10
+ indeterminate />
7
11
```
8
12
9
13
### Script
10
14
11
15
``` javascript
12
- this .$refs .progress .show ()
13
- this .$refs .progress .hide ()
16
+ data () {
17
+ return {
18
+ isProgressOpen: true
19
+ }
20
+ }
14
21
```
15
22
16
- ### Props & methods
23
+ ### Props
17
24
18
25
| Prop | Type | Default | Required | Description |
19
26
| ------| ------| ---------| ----------| -------------|
20
- | open | Boolean | - | false | initial state |
21
- | indeterminate | Boolean | - | false | indeterminate state |
22
- | reverse | Boolean | - | false | reverse direction of progress |
27
+ | open | Boolean | false | - | linear progress starts in open state |
28
+ | indeterminate | Boolean | false | - | indeterminate state |
29
+ | reverse | Boolean | false | - | reverse direction of progress |
23
30
| progress | Number | - | false | progress value between 0 and 1 |
24
31
| buffer | Number | - | false | buffer value between 0 and 1 |
25
32
26
- | Method | Description |
27
- | --------| -------------|
28
- | show | show the progress |
29
- | hide | hide the progress |
30
-
31
33
### Reference
32
34
33
- - https://github.com/material-components/material-components-web/tree/master/packages/mdc-linear-progress
35
+ - https://github.com/material-components/material-components-web/tree/master/packages/mdc-linear-progress
Original file line number Diff line number Diff line change 5
5
<m-layout-grid-inner >
6
6
<m-layout-grid-cell :span =" 4" >
7
7
<m-linear-progress
8
- ref =" progress"
9
- open
8
+ :open =" isProgressOpen"
10
9
:progress =" 0.5"
11
10
:buffer =" 0.5"
12
11
indeterminate />
13
12
</m-layout-grid-cell >
14
13
<m-layout-grid-cell :span =" 8" />
15
14
<m-layout-grid-cell :span =" 1" >
16
15
<m-button
17
- @click =" stopProgress "
16
+ @click =" isProgressOpen = !isProgressOpen "
18
17
raised
19
- interactive >
20
- hide
21
- </m-button >
22
- </m-layout-grid-cell >
23
- <m-layout-grid-cell :span =" 1" >
24
- <m-button
25
- @click =" startProgress"
26
- stroked >
27
- show
28
- </m-button >
18
+ interactive >toggle</m-button >
29
19
</m-layout-grid-cell >
30
20
</m-layout-grid-inner >
31
21
</m-layout-grid-cell >
@@ -43,17 +33,9 @@ Vue.use(LinearProgress)
43
33
export default {
44
34
data () {
45
35
return {
36
+ isProgressOpen: true
46
37
}
47
- },
48
- methods: {
49
- stopProgress () {
50
- this .$refs .progress .hide ()
51
- },
52
- startProgress () {
53
- this .$refs .progress .show ()
54
- }
55
- }
56
- }
38
+ }}
57
39
</script >
58
40
59
41
<style lang="scss">
You can’t perform that action at this time.
0 commit comments