action-sheet.js 529 B

12345678910111213141516171819202122232425262728
  1. Page({
  2. onShareAppMessage() {
  3. return {
  4. title: '操作菜单',
  5. path: 'packageAPI/pages/page/action-sheet/action-sheet'
  6. }
  7. },
  8. actionSheetTap() {
  9. wx.showActionSheet({
  10. itemList: ['item1', 'item2', 'item3', 'item4'],
  11. success(e) {
  12. console.log(e.tapIndex)
  13. }
  14. })
  15. },
  16. onLoad() {
  17. this.setData({
  18. theme: wx.getSystemInfoSync().theme || 'light'
  19. })
  20. if (wx.onThemeChange) {
  21. wx.onThemeChange(({theme}) => {
  22. this.setData({theme})
  23. })
  24. }
  25. }
  26. })