123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div class="simple-dialog" v-if="value">
- <div class="simple-dialog__container">
- <span
- class="el-icon-close simple-dialog__colse"
- @click="onCloseClick"
- ></span>
- <div class="simple-dialog__title">
- <span class="simple-dialog__title__text">提示</span>
- <slot name="title"></slot>
- </div>
- <div class="simple-dialog__content">
- <slot></slot>
- <span class="simple-dialog__content__text">这是内容</span>
- </div>
- <div class="simple-dialog__footer">
- <slot name="footer"></slot>
- <div
- class="simple-dialog__confirm"
- v-if="!$slots.footer"
- @click="onClick"
- >
- 确定
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- model: {
- prop: 'value',
- event: 'change',
- },
- props: {
- value: {
- type: Boolean,
- default: false,
- },
- },
- methods: {
- onCloseClick() {
- this.$emit('change', false)
- },
- onClick() {
- this.$emit('click')
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .simple-dialog {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.39);
- .simple-dialog__container {
- position: relative;
- width: 76vw;
- min-height: 20vw;
- background: #fff;
- .simple-dialog__colse {
- width: 6.4vw;
- height: 6.4vw;
- font-size: 5vw;
- position: absolute;
- top: 3vw;
- right: 3vw;
- text-align: center;
- line-height: 6.4vw;
- color: #c2c2c2;
- }
- .simple-dialog__title {
- padding: 3vw 4.8vw;
- border-bottom: 1px solid #c2c2c2;
- .simple-dialog__title__text {
- font-size: 4.2vw;
- color: #282828;
- }
- }
- .simple-dialog__content {
- padding: 3vw 4.8vw;
- .simple-dialog__content__text {
- font-size: 3.6vw;
- color: #282828;
- }
- }
- .simple-dialog__footer {
- padding: 0 4.8vw 7vw;
- .simple-dialog__confirm {
- width: 100%;
- height: 8.8vw;
- text-align: center;
- background: #f3920d;
- color: #fff;
- line-height: 8.8vw;
- font-size: 3.6vw;
- }
- }
- }
- }
- </style>
|