first commit
This commit is contained in:
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/draggable.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/draggable.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const t=require("../common/src/instantiationDecorator.js"),e=require("../common/config.js"),o=require("./props.js"),s=require("../common/utils.js"),i=require("../common/utils.wxs.js"),r=require("../../../../common/vendor.js"),n=require("../common/wechat.js"),c=`${e.prefix}-draggable`,h=t.uniComponent({name:c,options:{styleIsolation:"shared"},props:{...o.props},emits:["move","start","end"],data:()=>({prefix:e.prefix,classPrefix:c,tools:i.tools,systemInfo:n.getWindowInfo()}),mounted(){this.computedRect()},methods:{onTouchStart(t){const{systemInfo:e}=this;"none"!==this.direction&&(this.startX=t.touches[0].clientX+e.windowWidth-this.rect.right,this.startY=t.touches[0].clientY+e.windowHeight-this.rect.bottom,this.$emit("start",{startX:this.startX,startY:this.startY,rect:this.rect,e:t}))},onTouchMove(t){const{systemInfo:e}=this;if("none"===this.direction)return;let o=this.startX-t.touches[0].clientX,s=this.startY-t.touches[0].clientY;"vertical"===this.direction&&(o=e.windowWidth-this.rect.right),"horizontal"===this.direction&&(s=e.windowHeight-this.rect.bottom),this.$emit("move",{x:o,y:s,rect:this.rect,e:t})},async onTouchEnd(t){"none"!==this.direction&&(await this.computedRect(),this.$emit("end",{rect:this.rect,e:t}))},async computedRect(){this.rect={right:0,bottom:0,width:0,height:0};try{this.rect=await s.getRect(this,`.${this.classPrefix}`)}catch(t){}}}});const a=r._export_sfc(h,[["render",function(t,e,o,s,i,n){return{a:r.n(t.classPrefix),b:r.n(t.tClass),c:r.s(t.tools._style([t.customStyle])),d:r.o(((...e)=>t.onTouchStart&&t.onTouchStart(...e))),e:r.o(((...e)=>t.onTouchMove&&t.onTouchMove(...e))),f:r.o(((...e)=>t.onTouchEnd&&t.onTouchEnd(...e)))}}],["__scopeId","data-v-74d90c49"]]);wx.createComponent(a);
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<view class="{{['data-v-74d90c49', a, b]}}" style="{{c}}" bindtouchstart="{{d}}" catchtouchmove="{{e}}" bindtouchend="{{f}}"><slot/></view>
|
||||
@@ -0,0 +1 @@
|
||||
.hotspot-expanded.relative.data-v-74d90c49{position:relative}.hotspot-expanded.data-v-74d90c49:after{content:"";display:block;position:absolute;left:0;top:0;right:0;bottom:0;transform:scale(1.5)}.t-draggable.data-v-74d90c49{position:fixed}
|
||||
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/props.js
vendored
Normal file
1
unpackage/dist/build/mp-weixin/uni_modules/tdesign-uniapp/components/draggable/props.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";const t={direction:{type:String,value:"all"},tClass:{type:String,default:""},tClassButton:{type:String,default:""},customStyle:{type:[String,Object],default:""}};exports.props=t;
|
||||
Reference in New Issue
Block a user