123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <template>
- <a-modal
- centered
- class="promotionDesc-modal"
- :footer="null"
- :maskClosable="false"
- :title="modalTit"
- v-model="isShow"
- @cancel="isShow=false"
- :width="500">
- <div class="promotionDesc-con">
- <img :src="con" alt="图片走丢了" />
- </div>
- <div class="btn-cont">
- <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
- </div>
- </a-modal>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- export default {
- name: 'PromotionDescModal',
- mixins: [commonMixin],
- props: {
- openModal: { // 弹框显示状态
- type: Boolean,
- default: false
- },
- con: { // 弹框显示状态
- type: String,
- default: ''
- }
- },
- data () {
- return {
- modalTit: '预览',
- isShow: this.openModal // 是否打开弹框
- }
- },
- watch: {
- // 父页面传过来的弹框状态
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('close')
- }
- }
- }
- }
- </script>
- <style lang="less">
- .promotionDesc-modal{
- .promotionDesc-con{
- width:90%;
- margin:0 auto;
- max-height:700px;
- overflow-y:scroll;
- scrollbar-width: none;
- img{
- width:100%;
- height:auto;
- object-fit:cover;
- }
- }
- .btn-cont {
- text-align: center;
- margin: 50px 0 0px;
- }
- }
- </style>
|