index.wxml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <wux-popup visible="{{ visible1 }}" content="微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp" bind:close="onClose" data-key="1" />
  2. <wux-popup position="top" visible="{{ visible2 }}" content="微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp" contentStyle="{{ { height: '40vh', padding: '30px' } }}" bind:close="onClose" data-key="2" />
  3. <wux-popup position="right" visible="{{ visible3 }}" content="微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp" contentStyle="{{ { width: 'auto', padding: '30px' } }}" bind:close="onClose" data-key="3" />
  4. <wux-popup position="bottom" visible="{{ visible4 }}" content="微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp" contentStyle="{{ { height: '40vh', padding: '30px' } }}" bind:close="onClose" data-key="4" />
  5. <wux-popup position="left" visible="{{ visible5 }}" content="微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp" contentStyle="{{ { width: 'auto', padding: '30px' } }}" bind:close="onClose" data-key="5" />
  6. <wux-popup
  7. position="bottom"
  8. visible="{{ visible6 }}"
  9. contentStyle="{{ { borderTopLeftRadius: '8px', borderTopRightRadius: '8px', minHeight: '40vh', padding: '30px' } }}"
  10. bind:close="onClose"
  11. data-key="6"
  12. >
  13. <view>微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp</view>
  14. </wux-popup>
  15. <wux-popup
  16. closable
  17. visible="{{ visible7 }}"
  18. title="Delete"
  19. content="Are you sure???"
  20. bind:showed="onShowed"
  21. bind:close="onClose"
  22. bind:closed="onClosed"
  23. data-key="7"
  24. >
  25. <view slot="footer" class="popup__button" bindtap="onClose" data-key="7">OK</view>
  26. </wux-popup>
  27. <wux-popup
  28. position="bottom"
  29. visible="{{ visible8 }}"
  30. contentStyle="{{ { height: '540rpx' } }}"
  31. bind:close="onClose"
  32. data-key="8"
  33. >
  34. <scroll-view scroll-y style="height: 540rpx;">
  35. <wux-cell-group>
  36. <block wx:for="{{ 20 }}" wx:key="index">
  37. <wux-cell hover-class="none" title="Your father is Jack Ma"></wux-cell>
  38. </block>
  39. <wux-cell hover-class="none">
  40. <wux-button block type="balanced" bindtap="onClose" data-key="8">Yes</wux-button>
  41. </wux-cell>
  42. </wux-cell-group>
  43. </scroll-view>
  44. </wux-popup>
  45. <wux-popup
  46. closable
  47. position="right"
  48. visible="{{ visible9 }}"
  49. containerStyle="{{ { width: '100%', maxWidth: '100%' } }}"
  50. contentStyle="{{ { width: 'auto', padding: '40px 30px 30px' } }}"
  51. bind:close="onClose"
  52. data-key="9"
  53. >
  54. <view>微信小程序自定义组件 https://github.com/wux-weapp/wux-weapp</view>
  55. </wux-popup>
  56. <wux-popup
  57. position="bottom"
  58. visible="{{ visible10 }}"
  59. contentStyle="{{ { minHeight: '40vh', padding: '30px' } }}"
  60. bind:close="onClose"
  61. data-key="10"
  62. >
  63. <view>这是第一个弹出层...这是第一个弹出层...</view>
  64. <wux-button block type="stable" bind:click="onOpen" data-key="11">显示第二个弹出层</wux-button>
  65. </wux-popup>
  66. <wux-popup
  67. position="bottom"
  68. visible="{{ visible11 }}"
  69. contentStyle="{{ { minHeight: '20vh', padding: '30px' } }}"
  70. bind:close="onClose"
  71. data-key="11"
  72. >
  73. <view>这是第二个弹出层...这是第二个弹出层...</view>
  74. </wux-popup>
  75. <view class="page">
  76. <view class="page__hd">
  77. <view class="page__title">Popup</view>
  78. <view class="page__desc">弹出框</view>
  79. </view>
  80. <view class="page__bd page__bd_spacing">
  81. <view class="sub-title">弹出位置</view>
  82. <wux-button block type="light" bind:click="onOpen" data-key="1">中间弹出</wux-button>
  83. <wux-button block type="light" bind:click="onOpen" data-key="2">顶部弹出</wux-button>
  84. <wux-button block type="light" bind:click="onOpen" data-key="3">右部弹出</wux-button>
  85. <wux-button block type="light" bind:click="onOpen" data-key="4">底部弹出</wux-button>
  86. <wux-button block type="light" bind:click="onOpen" data-key="5">左部弹出</wux-button>
  87. <view class="sub-title">自定义样式</view>
  88. <wux-button block type="light" bind:click="onOpen" data-key="6">圆角的弹出层</wux-button>
  89. <wux-button block type="light" bind:click="onOpen" data-key="7">显示关闭按钮</wux-button>
  90. <wux-button block type="light" bind:click="onOpen" data-key="8">内容超长滚动</wux-button>
  91. <wux-button block type="light" bind:click="onOpen" data-key="9">显示右侧弹出关闭按钮</wux-button>
  92. <wux-button block type="light" bind:click="onOpen" data-key="10">多层堆叠</wux-button>
  93. </view>
  94. </view>