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 {
2323 props: {
2424 open: {
2525 type: Boolean ,
26- required : false
26+ default : false
2727 },
2828 indeterminate: {
2929 type: Boolean ,
30- required : false
30+ default : false
3131 },
3232 reverse: {
3333 type: Boolean ,
34- required : false
34+ default : false
3535 },
3636 progress: {
3737 type: Number ,
@@ -76,14 +76,6 @@ export default {
7676 },
7777 beforeDestroy () {
7878 this .mdcLinearProgress .destroy ()
79- },
80- methods: {
81- show () {
82- this .mdcLinearProgress .open ()
83- },
84- hide () {
85- this .mdcLinearProgress .close ()
86- }
8779 }
8880}
8981 </script >
Original file line number Diff line number Diff line change 33### Markup
44
55``` 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 />
711```
812
913### Script
1014
1115``` javascript
12- this .$refs .progress .show ()
13- this .$refs .progress .hide ()
16+ data () {
17+ return {
18+ isProgressOpen: true
19+ }
20+ }
1421```
1522
16- ### Props & methods
23+ ### Props
1724
1825| Prop | Type | Default | Required | Description |
1926| ------| ------| ---------| ----------| -------------|
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 |
2330| progress | Number | - | false | progress value between 0 and 1 |
2431| buffer | Number | - | false | buffer value between 0 and 1 |
2532
26- | Method | Description |
27- | --------| -------------|
28- | show | show the progress |
29- | hide | hide the progress |
30-
3133### Reference
3234
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 55 <m-layout-grid-inner >
66 <m-layout-grid-cell :span =" 4" >
77 <m-linear-progress
8- ref =" progress"
9- open
8+ :open =" isProgressOpen"
109 :progress =" 0.5"
1110 :buffer =" 0.5"
1211 indeterminate />
1312 </m-layout-grid-cell >
1413 <m-layout-grid-cell :span =" 8" />
1514 <m-layout-grid-cell :span =" 1" >
1615 <m-button
17- @click =" stopProgress "
16+ @click =" isProgressOpen = !isProgressOpen "
1817 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 >
2919 </m-layout-grid-cell >
3020 </m-layout-grid-inner >
3121 </m-layout-grid-cell >
@@ -43,17 +33,9 @@ Vue.use(LinearProgress)
4333export default {
4434 data () {
4535 return {
36+ isProgressOpen: true
4637 }
47- },
48- methods: {
49- stopProgress () {
50- this .$refs .progress .hide ()
51- },
52- startProgress () {
53- this .$refs .progress .show ()
54- }
55- }
56- }
38+ }}
5739 </script >
5840
5941<style lang="scss">
You can’t perform that action at this time.
0 commit comments