modal.vue 970 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <view>
  3. <page-head :title="title"></page-head>
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <view class="uni-btn-v">
  6. <button type="default" @tap="modalTap">有标题的modal</button>
  7. <button type="default" @tap="noTitlemodalTap">无标题的modal</button>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. title: 'modal',
  17. modalHidden: true,
  18. modalHidden2: true
  19. }
  20. },
  21. methods: {
  22. modalTap: function (e) {
  23. uni.showModal({
  24. title: "弹窗标题",
  25. content: "弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内",
  26. showCancel: false,
  27. confirmText: "确定"
  28. })
  29. },
  30. noTitlemodalTap: function (e) {
  31. uni.showModal({
  32. content: "弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内",
  33. confirmText: "确定",
  34. cancelText: "取消"
  35. })
  36. }
  37. }
  38. }
  39. </script>