index.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import ad from '../index/ad'
  2. ad({
  3. onLoad() {
  4. const App = this.selectComponent('#wux-app')
  5. const { dialog, loading, notification, toast, toptips } = App.useApp()
  6. this.showDialog = () => dialog.alert({
  7. title: 'This is a warning message',
  8. content: 'some messages...some messages...some messages...',
  9. confirmText: 'ok',
  10. })
  11. this.showLoading = () => {
  12. loading.show({
  13. text: 'Loading...',
  14. })
  15. setTimeout(() => {
  16. loading.hide()
  17. }, 3000)
  18. }
  19. this.showNotification = () => notification.show({
  20. image: 'http://cdn.skyvow.cn/logo.png',
  21. title: 'Notification Title',
  22. text: 'This is the content of the notification.',
  23. })
  24. this.showToast = () => toast.success({
  25. text: 'Success!',
  26. })
  27. this.showToptips = () => toptips.info({
  28. text: 'This is a tip at the top',
  29. })
  30. },
  31. })