action-sheet.vue 658 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view>
  3. <page-head :title="title"></page-head>
  4. <view class="uni-padding-wrap">
  5. <view class="uni-btn-v">
  6. <button type="default" @tap="actionSheetTap">弹出action sheet</button>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. title: 'action-sheet'
  16. }
  17. },
  18. methods: {
  19. actionSheetTap() {
  20. uni.showActionSheet({
  21. title:'标题',
  22. itemList: ['item1', 'item2', 'item3', 'item4'],
  23. success: (e) => {
  24. console.log(e.tapIndex);
  25. uni.showToast({
  26. title:"点击了第" + e.tapIndex + "个选项",
  27. icon:"none"
  28. })
  29. }
  30. })
  31. }
  32. }
  33. }
  34. </script>