调整情绪版layout出现拉伸的问题
This commit is contained in:
@@ -34,8 +34,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout_centent" :class="{active:flex_direction}" id="layoutCentent">
|
||||
<div v-for="item,index in layoutList" :key="item" :class="moodbClassName[index]" class="modal_imgItem" v-layout="item" @mousedown="setpitch(item,index)" @touchstart="setpitch(item,index)" ref="content" >
|
||||
<img crossOrigin="anonymous" :src="item.imgUrl" :style="{'transform':`translate(-50%, -50%) scale(${item.zoom?item.zoom:1}) rotateZ(${item.angle?item.angle:0}deg)`}" draggable="false" :class="moodbClassName[index]" v-modelImg>
|
||||
<div v-for="item,index in layoutList" :key="item" :class="moodbClassName[index]" class="modal_imgItem" v-layout="item" @mousedown="setpitch(item,index)" @touchstart="setpitch(item,index)" ref="content" :style="{'background-image':`url(${item.imgUrl})`,'transform':`scale(${item.zoom?item.zoom:1}) rotateZ(${item.angle?item.angle:0}deg)`}">
|
||||
<!-- <img crossOrigin="anonymous" :src="item.imgUrl" :style="{'transform':`translate(-50%, -50%) scale(${item.zoom?item.zoom:1}) rotateZ(${item.angle?item.angle:0}deg)`}" draggable="false" :class="moodbClassName[index]" v-modelImg> -->
|
||||
<ul v-show="item.setPitch" class="layout_btn" >
|
||||
<li class="layout_btn_top" v-compile.stop="'top'"></li>
|
||||
<li class="layout_btn_bottom" v-compile.stop="'bottom'"></li>
|
||||
@@ -736,6 +736,7 @@ export default defineComponent({
|
||||
setmoodb(item:any){
|
||||
this.moodbClassName = item
|
||||
this.$emit('setmoodbClass',this.moodbClassName)
|
||||
this.styleObj.class = this.moodbClassName
|
||||
if(this.content){
|
||||
for (item of (this.content as any)) {
|
||||
item.classList.remove('active')
|
||||
@@ -772,7 +773,7 @@ export default defineComponent({
|
||||
initDomStyle(){
|
||||
nextTick(()=>{
|
||||
this.content.forEach((item:any,index:any) => {
|
||||
if(this.styleObj.domStyle[index]){
|
||||
if(this.styleObj.domStyle[index]?.left){
|
||||
item.classList.add('active')
|
||||
this.initStyle(item,this.styleObj.domStyle[index])
|
||||
}
|
||||
@@ -794,7 +795,7 @@ export default defineComponent({
|
||||
})
|
||||
},
|
||||
initStyle(dom:any,style:any){
|
||||
if(!style)return
|
||||
if(!style || !dom)return
|
||||
for (const [property, value] of Object.entries(style)) {
|
||||
|
||||
dom.style.setProperty(property, value);
|
||||
@@ -806,7 +807,7 @@ export default defineComponent({
|
||||
this.styleObj.domStyle.push(this.setStyle(item.style))
|
||||
this.domObj.dom.forEach((domName:any,index:any) => {
|
||||
let style = this.domObj.domStyle[index]
|
||||
let dom = item.querySelector(domName)
|
||||
let dom = item.querySelector(domName) || item
|
||||
this.styleObj[style].push(this.setStyle(dom.style))
|
||||
})
|
||||
});
|
||||
@@ -840,7 +841,6 @@ export default defineComponent({
|
||||
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
|
||||
Https.axiosPost(Https.httpUrls.elementUpload,param,config)
|
||||
.then((rv: any) => {
|
||||
// console.log(rv);
|
||||
rv.imgUrl = rv.url
|
||||
this.layout = false
|
||||
this.loadingShow = false
|
||||
@@ -1062,27 +1062,12 @@ export default defineComponent({
|
||||
// height: 100%;
|
||||
// }
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
&.active{
|
||||
position: absolute;
|
||||
}
|
||||
img{
|
||||
// object-fit: cover;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
pointer-events: none;
|
||||
float: left;
|
||||
user-select:none;
|
||||
-webkit-user-drag: none;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%,-50%) scale(1);
|
||||
}
|
||||
::selection {
|
||||
// background: rgba(0,0,0,0);
|
||||
// background: yellow;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.wh1{
|
||||
|
||||
Reference in New Issue
Block a user