var storeShowStyle = '
' storeShowStyle += '
'; storeShowStyle += ''; storeShowStyle += '
'; storeShowStyle += '
{{data.styleName}}
'; storeShowStyle += '
选择
'; storeShowStyle += '
'; storeShowStyle += '
'; storeShowStyle += ''; storeShowStyle += ''; storeShowStyle += '
'; Vue.component("store-show-style", { template: storeShowStyle, data: function() { return { data: this.$parent.data, } }, created:function() { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify: function () { var res = { code: true, message: "" }; return res; }, selectGoodsStyle: function() { var self = this; layer.open({ type: 1, title: '风格选择', area:['930px','630px'], btn: ['确定', '返回'], content: $(".draggable-element[data-index='" + self.data.index + "'] .edit-attribute .goods-list-style").html(), success: function(layero, index) { $(".layui-layer-content input[name='style']").val(self.data.style); $(".layui-layer-content input[name='style_name']").val(self.data.styleName); $("body").on("click", ".layui-layer-content .style-list-con-store .style-li-goods", function () { $(this).addClass("selected ns-border-color").siblings().removeClass("selected ns-border-color"); $(".layui-layer-content input[name='style']").val($(this).index() + 1); $(".layui-layer-content input[name='style_name']").val($(this).find("span").text()); }); }, yes: function (index, layero) { self.data.style = $(".layui-layer-content input[name='style']").val(); self.data.styleName = $(".layui-layer-content input[name='style_name']").val(); layer.closeAll() } }); }, } });