var searchHtml = '
'; Vue.component("goods-search", { props: { data: { type: Object, default: function () { return { field: "textAlign", label: "文本位置" }; } } }, data: function () { return { list: [ { label: "居左", value: "left", icon_img:searchResourcePath + "/search/img/text_left.png", icon_img_active:searchResourcePath + "/search/img/text_left_hover.png" }, { label: "居中", value: "center", icon_img:searchResourcePath + "/search/img/text_right.png", icon_img_active:searchResourcePath + "/search/img/text_right_hover.png" }, ], parent: this.$parent.data, }; }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 if (this.data.label == undefined) this.data.label = "文本位置"; if (this.data.field == undefined) this.data.field = "textAlign"; var self = this; setTimeout(function () { layui.use(['form'], function() { self.form = layui.form; self.form.render(); }); },10); //设置默认logo var error_img = $('input[name="d_elem"]').val() if(!this.parent.searchImg){this.parent.searchImg = error_img;} }, watch: { data: function (val, oldVal) { if (val.field == undefined) val.field = oldVal.field; if (val.label == undefined) val.label = "文本位置"; }, }, methods: { verify : function () { var res = { code : true, message : "" }; return res; } }, template: searchHtml }); var borderHtml = ' '; Vue.component("search-border", { props: { data: { type: Object, default: function () { return { field: "borderType", label: "框体样式" }; } } }, data: function () { return { list: [ { label: "方形", value: 1, icon_img:searchResourcePath + "/search/img/border1.png", icon_img_active:searchResourcePath + "/search/img/border1_hover.png" }, { label: "圆形", value: 2, icon_img:searchResourcePath + "/search/img/border2.png", icon_img_active:searchResourcePath + "/search/img/border2_hover.png" }, ], parent: this.$parent.data, }; }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 if (this.data.label == undefined) this.data.label = "框体样式"; if (this.data.field == undefined) this.data.field = "borderType"; var self = this; setTimeout(function () { layui.use(['form'], function() { self.form = layui.form; self.form.render(); }); },10); }, watch: { data: function (val, oldVal) { if (val.field == undefined) val.field = oldVal.field; if (val.label == undefined) val.label = "框体样式"; }, }, methods: { verify : function () { var res = { code : true, message : "" }; return res; }, }, template: borderHtml }); var typeHtml = '