<template src="./template.html">

</template>

<script>
    import imgInput from "../img_input.vue";
    import footTemplate from '../footTemplate.vue';
    export default {
        props:{
            switchOn:Boolean,
            perviewOn:Boolean,
            updateData:String,
        },
        data() {
            var serverUrl = 'http://skyforest.static.elab-plus.com/temp/template27/';
            return {
                uploading:false,
                disabled:false,
                serverUrl:serverUrl,
                isshow:true,
                placeholder:'壮年岁月，不可挽回的进入人生的分水岭',
                obj:{
                    text1:'',
                    text2:'',
                    text3:'',
                    text4:'',
                    text5:'',
                    text6:'',
                    text7:'',
                    text8:'',
                    text9:'',
                    text10:'',
                    text11:'',
                    text12:'',
                    text13:'',
                    text14:'',
                    text15:'',
                    text16:'',
                    text17:'',
                    text18:'',
                    text19:'',
                    text20:'',
                    text21:'',
                    text22:'',
                    text23:'',
                    logoUrl:`${serverUrl}LOGO.png`,
                    picUrl1:`${serverUrl}pic1.png`,
                    picUrl2:[`${serverUrl}pic2.png`,`${serverUrl}pic2.png`,`${serverUrl}pic2.png`],
                    picUrl3:[`${serverUrl}pic3.png`,`${serverUrl}pic3.png`,`${serverUrl}pic3.png`],
                    picUrl4:[`${serverUrl}pic4.png`,`${serverUrl}pic4.png`,`${serverUrl}pic4.png`],
                    picUrl5:[`${serverUrl}pic5.png`,`${serverUrl}pic5.png`,`${serverUrl}pic5.png`],
                }
            }
        },
        mounted() {
            console.log(this.updateData,'123465789');
            if(this.updateData){
                this.obj=JSON.parse(this.updateData);
            }
        },
        watch:{
            switchOn(val){
                if(val){
                    this.$emit('com',this.obj)
                }
            },
            perviewOn(val){
                this.disabled=val;
                this.isshow=!val;
            },
            updateData(val){
                if(val){
                    val=JSON.parse(val);
                    this.obj = val;
                }
            }
        },
        components:{
            imgInput,
            footTemplate
        },
        methods: {}
    }
</script>

<style lang="scss" scoped>
    @import "../../assets/common.scss";
    @import "./style.scss";
</style>
