| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <script>
- export default {
- name: "ModalPopup",
- props: {
- title: {
- type: String,
- default: "标题"
- },
- showBack: {
- type: Boolean,
- default: false,
- }
- },
- }
- </script>
- <template>
- <van-popup v-bind="$attrs" v-on="$listeners" position="bottom" round get-container="body">
- <div class="c-header">
- <img src="@/assets/arrow.png" class="back-icon" v-if="showBack" @click="$emit('back')" />
- <div class="title-row">
- {{ title }}
- </div>
- </div>
- <slot></slot>
- </van-popup>
- </template>
- <style scoped>
- /deep/.van-popup--round {
- border-radius: 8px !important;
- }
- .c-header {
- display: flex;
- align-items: center;
- box-sizing: border-box;
- padding: 16px 20px;
- position: relative;
- }
- .back-icon {
- width: 12px;
- height: 12px;
- position: absolute;
- }
- .title-row {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 600;
- font-size: 14px;
- color: #333333;
- }
- </style>
|