Skip to content

Commit db45d57

Browse files
authored
Merge pull request #1 from CommanderXL/dev
update action-sheet demo and doc
2 parents 0a5171f + 1fc9e1a commit db45d57

File tree

3 files changed

+90
-6
lines changed

3 files changed

+90
-6
lines changed

document/components/docs/en-US/action-sheet.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,21 @@ export default {
6565
{
6666
content: '豪华型'
6767
}
68-
]
68+
],
69+
onSelect: (item, index) => {
70+
this.$createToast({
71+
txt: `Clicked ${item.content}`,
72+
type: 'correct',
73+
time: 1000
74+
}).show()
75+
},
76+
onCancel: () => {
77+
this.$createToast({
78+
txt: `Clicked canceled`,
79+
type: 'warn',
80+
time: 1000
81+
}).show()
82+
}
6983
}).show()
7084
}
7185
}
@@ -96,7 +110,21 @@ export default {
96110
{
97111
content: '豪华型'
98112
}
99-
]
113+
],
114+
onSelect: (item, index) => {
115+
this.$createToast({
116+
txt: `Clicked ${item.content}`,
117+
type: 'correct',
118+
time: 1000
119+
}).show()
120+
},
121+
onCancel: () => {
122+
this.$createToast({
123+
txt: `Clicked canceled`,
124+
type: 'warn',
125+
time: 1000
126+
}).show()
127+
}
100128
}).show()
101129
}
102130
}

document/components/docs/zh-CN/action-sheet.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,21 @@
6565
{
6666
content: '豪华型'
6767
}
68-
]
68+
],
69+
onSelect: (item, index) => {
70+
this.$createToast({
71+
txt: `Clicked ${item.content}`,
72+
type: 'correct',
73+
time: 1000
74+
}).show()
75+
},
76+
onCancel: () => {
77+
this.$createToast({
78+
txt: `Clicked canceled`,
79+
type: 'warn',
80+
time: 1000
81+
}).show()
82+
}
6983
}).show()
7084
}
7185
}
@@ -95,7 +109,21 @@
95109
{
96110
content: '豪华型'
97111
}
98-
]
112+
],
113+
onSelect: (item, index) => {
114+
this.$createToast({
115+
txt: `Clicked ${item.content}`,
116+
type: 'correct',
117+
time: 1000
118+
}).show()
119+
},
120+
onCancel: () => {
121+
this.$createToast({
122+
txt: `Clicked canceled`,
123+
type: 'warn',
124+
time: 1000
125+
}).show()
126+
}
99127
}).show()
100128
}
101129
}

example/pages/action-sheet.vue

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,21 @@
5757
{
5858
content: '豪华型'
5959
}
60-
]
60+
],
61+
onSelect: (item, index) => {
62+
this.$createToast({
63+
txt: `Clicked ${item.content}`,
64+
type: 'correct',
65+
time: 1000
66+
}).show()
67+
},
68+
onCancel: () => {
69+
this.$createToast({
70+
txt: `Clicked canceled`,
71+
type: 'warn',
72+
time: 1000
73+
}).show()
74+
}
6175
})
6276
this.actionSheet.show()
6377
},
@@ -75,7 +89,21 @@
7589
{
7690
content: '豪华型'
7791
}
78-
]
92+
],
93+
onSelect: (item, index) => {
94+
this.$createToast({
95+
txt: `Clicked ${item.content}`,
96+
type: 'correct',
97+
time: 1000
98+
}).show()
99+
},
100+
onCancel: () => {
101+
this.$createToast({
102+
txt: `Clicked canceled`,
103+
type: 'warn',
104+
time: 1000
105+
}).show()
106+
}
79107
})
80108
this.actionSheet.show()
81109
}

0 commit comments

Comments
 (0)