<template>
    <div style="width:100%;">
        <div>
            <div class="item-style">
                <i-switch v-model="value"></i-switch>
            </div>
        </div>
        <div v-show="value">
            <div class="title-style">校验</div>
            <validateArr></validateArr>

        </div>
    </div>
</template>

<script>
    import * as components from './style';
    import {PropertyMixin} from '../../service/main-tool-editor-type-mixin';
    import validateArr from '../main-tool-editor-type-box-validateArr';
    import eventbus from '../../service/eventbus';
    export default {
        components: {
            ...components,
            validateArr

        },
        mixins: [PropertyMixin],
        position: 'mainToolEditorTypeIdCardHeightLevel',
        name: 'main-tool-editor-type-idCardHeightLevel',
        data() {
            return {
                value: this.editor.value || false,
                isTextarea:false
            };
        },
        mounted() {
            this.initCurrtField();
            this.setInstanceProps(this.value);
            eventbus.$off("computIsShow");
            eventbus.$on("computIsShow", (data) => {
                debugger;
               if(data.com!=""){
                   this.isTextarea=false;
               }else{
                   this.isTextarea=true;
               }
            });
        },
        computed: {
            getLineNums() {
                debugger;
                let currentInstance = this.$store.state.viewport.instances.get(this.$store.state.viewport.currentEditInstanceKey);
                //note 为事件新增一项
                if (!currentInstance.data.extend.rows) {
                    currentInstance.data.extend.rows = 1;
                }
                return currentInstance.data.extend.rows ;
            },
            applicationState() {

                return this.$store.state.application;
            },
            viewportState() {
                return this.$store.state.viewport;
            }
        },
        methods: {
            handleChange() {

            }
        },
        watch: {
            value(n, o) {
                if (n === o) {
                    return;
                }
                this.setInstanceProps(n);
            }
        }
    };
</script>

<style scoped>

</style>
