c-popup


蒙层

示例

  1. <template>
  2. <view class="popup-page">
  3. <c-popup show="{{show}}" mask="{{mask}}" c-bind:close="close"></c-popup>
  4. <button btn-style="{{btnStyle}}" text="show popup" c-bind:onclick="showPopup"></button>
  5. </view>
  6. </template>
  7. <script>
  8. class C_popup {
  9. data = {
  10. show: false,
  11. headerTitle: "c-popup",
  12. headerDesc: "c-popup",
  13. mask: true,
  14. btnStyle: "margin-bottom: 20cpx"
  15. }
  16. methods = {
  17. showPopup() {
  18. this.show = true;
  19. },
  20. close() {
  21. this.show = false;
  22. }
  23. }
  24. };
  25. export default new C_popup();
  26. </script>
  27. <script cml-type="json">
  28. {
  29. "base":{
  30. "usingComponents": {
  31. "c-popup": "cml-ui/components/c-popup/c-popup"
  32. }
  33. }
  34. }
  35. </script>