根据配置项插入复选框

//checkbox.vue
<template>
    <div class="check">
        <input type="checkbox" class="box">
        <span class="text">wiaa</span>

    </div>
</template>

<script>

    export default {
        
    }
</script>

<style scoped>
   .check{
       width:400px;
       height:40px;
       border:1px solid;
       
   }
   .box{
       width:20px;
       height: 20px;
       background: #fff;
       border: 1px solid #999;
   }
   .text{
       width:100%;
       height:100%;
       line-height:20px;
   }
</style>
//validtor
<template>
    <div class="wrap">
        company<input type="text" >
        <checkBox class="check" v-show="isCheck"/>
    </div>
</template>

<script>
    import checkBox from "./checkBox.vue"
    export default {
        components:{checkBox},
        props:["configdata"],
        data() {
            return {
                isCheck:false
            }
        },
        mounted() {
              let {invoiceFields}=this.configdata
                // console.log(invoiceFields)
                let invoiceFieldsArr=Object.keys(invoiceFields)
                console.log(invoiceFieldsArr)

                     if(invoiceFieldsArr.includes("invoicePlayer")){
                        // this.$emit("change",invoiceFields.invoicePlayer)
                        this.isCheck=true
                        console.log(22);
                        
                }
        },
    }
</script>

<style scoped>
   .wrap{
       width:600px;
       height:300px;
       border:1px solid;
       position: relative;
   }
   .check{
       position: absolute;
       left: 20px;
       bottom: 20px;
   }
</style>
//confirm.vue
<template>
    <div>
        <div class="form">
            <div class="invoice">invoice</div>
            <button class="btn" @click="change()">change</button>
        </div>
        <div class="dialog" v-show="isShow">
            <valitor :configdata="configdata"/>
        </div>
    </div>
</template>

<script>
    import valitor from './valitor.vue'
    export default {
        components:{valitor},
        data() {
            return {
                isShow:false,
               
                configdata:{
                    invoiceFields:{
                        invoicePlayer:"word",
                        invoiceType:"ele"
                    }
                    
                }
            }
        },
        methods:{
            change(){
                this.isShow=true;
             
            }
        }
    }
</script>

<style scoped>
.form{
    width: 400px;
    height: 100px;
    border: 1px solid #000;
    display: flex;
    justify-content: space-between;
}
.invoice{
   width:100px
}
.btn{
    border:none;
    height: 18px;
    background:#fff;
    flex: 1;
    
}
</style>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值