index.vue 671 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <!-- 取消flex:1 -->
  3. <u-modal v-bind="__attrs" v-on="__listeners" class="u-modal-box">
  4. <slot></slot>
  5. </u-modal>
  6. </template>
  7. <script>
  8. import uModal from 'uview-ui/components/u-modal/props';
  9. const uProps = uModal.props;
  10. export default {
  11. name: 'cModal',
  12. props: {
  13. ...uProps,
  14. showCancelButton: {
  15. type: Boolean,
  16. default: true,
  17. },
  18. },
  19. computed: {
  20. __attrs() {
  21. return {
  22. ...this.$props,
  23. ...this.$attrs,
  24. };
  25. },
  26. __listeners() {
  27. return {
  28. ...this.$listeners,
  29. };
  30. },
  31. },
  32. };
  33. </script>
  34. <style scoped lang="scss">
  35. .u-modal-box {
  36. flex: 0 1 auto;
  37. /deep/.u-modal__content {
  38. & > uni-view {
  39. width: 100%;
  40. }
  41. }
  42. }
  43. </style>