Commit 48139478 authored by zhengke's avatar zhengke

修改

parent 96074263
......@@ -177,10 +177,7 @@
</el-select>
<div class="temp-list-wrap">
<div v-for="(subItem,subIndex) in detailsList" class="temp-list-item" :key="subIndex"
draggable="true" @dragstart="dragLeftStart($event,subItem)" @dragover="onDragover($event,subItem)">
<!-- <div v-for="(subItem,subIndex) in detailsList" class="temp-list-item" :key="subIndex"
draggable="true" @dragstart="dragLeftStart($event,subItem)"
@click="AddData(subItem)"> -->
draggable="true" @dragstart="dragLeftStart($event,subItem)">
<img v-if="subItem.TemplateData&&subItem.TemplateData.CoverImg" :src="subItem.TemplateData.CoverImg"
:alt="subItem.SubTemplateName" />
<div class="temp-font">{{subItem.SubTemplateName}}</div>
......@@ -189,13 +186,9 @@
</div>
<div class="WebSite_right">
<div class="WebSite_right_preview">
<!-- <div v-for="(item,index) in dataList" draggable="true" @dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)" @dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)" :key="index"> -->
<div v-for="(item,index) in dataList" draggable="true" @drop="drop($event,index)" @dragover="allowDrop($event)" @dragstart="handleDragStart($event, item)"
<div v-for="(item,index) in dataList" draggable="true" @drop="drop($event,index)" @dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)" @dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)" :key="index">
<div class="diy-component-preview">
<div class="WebSite_item">
<div class="ui-sortable-handle">
......@@ -340,6 +333,7 @@
otherdialog
},
methods: {
//右边上下拖动开始
handleDragStart(e, item) {
if(this.isDraggable){
this.dragging = item;
......@@ -369,6 +363,7 @@
this.dataList = newItems
}
},
//右边上下拖动结束
//显示弹窗
showDialog(item) {
this.isShowDialog = true;
......@@ -397,7 +392,7 @@
};
this.dataList.push(obj);
},
//从左拖动到右边开始
dragLeftStart(ev,item){
this.isDraggable=false;
var obj = {
......@@ -407,12 +402,7 @@
};
this.dragObj=obj;
},
onDragover(ev){
ev.stopPropagation();
},
allowDrop(ev){
ev.preventDefault();
},
//从左拖动到右边结束
drop(ev,index){
if(!this.isDraggable){
this.dataList.splice(index,0,this.dragObj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment