美文网首页
vue组件使用v-model

vue组件使用v-model

作者: 花影_62b4 | 来源:发表于2021-11-30 14:49 被阅读0次

    父组件
    <auto-audit-modal v-model="modalShow"/>
    子组件

    <template>
        <a-modal
           title="上报数据自动审核设置"
          :width="641"
          destroyOnClose
          :maskClosable="false"
          :visible="value"
          @cancel="handleCancel"   
          okText="保存"
          :confirm-loading="confirmLoading"
          @ok="handleOk"
        >
          
        </a-modal>
    </template>
    
    <script>
        export default {
            name:'auto-audit-modal',
            props:{
                value:{
                    type:Boolean,
                    default:false
                }
            },
            
            data(){
                return{
                    confirmLoading:false,
                }
            },
            methods:{
                handleOk(){},
                handleCancel(){                
                    this.$emit('input',false)
                },
            }
        }
    </script>
    
    <style lang="scss" scoped>
    
    </style>
    

    相关文章

      网友评论

          本文标题:vue组件使用v-model

          本文链接:https://www.haomeiwen.com/subject/zbjdxrtx.html