iview $modal 的封装
Posted haonanya
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iview $modal 的封装相关的知识,希望对你有一定的参考价值。
<template> <Modal v-model="isShow" :width="width" :title="title"> <slot name="content"></slot> <div slot="footer" class="modalFooterStyle"> <span class="editFormErrorStyle">{{ WarnMsg }}</span> <div> <Button type="success" :loading="loading" @click="submit">确认</Button> <Button class="cancelButton" @click="cancel">取消</Button> </div> </div> </Modal> </template> <script> export default { name: ‘ModalBlock‘, props: { isShow: { type: Boolean, default: false }, title: { type: String }, width: { type: Number }, loading: { type: Boolean, default: false }, WarnMsg: { type: String } }, methods: { cancel: function () { this.$emit(‘cancel‘); }, submit () { this.$emit(‘submit‘); } } } </script> <style scoped> </style>
引入
<modal-block :isShow="true" :title="‘123‘" :width="800" :WarnMsg="‘WarnMsg‘" > <div slot="content">123</div> </modal-block> import ModalBlock from ‘../public/ModalBlock‘; components: { ModalBlock },
以上是关于iview $modal 的封装的主要内容,如果未能解决你的问题,请参考以下文章
iview的modal点击确定消失问题,自定义modal页脚