Z F 7 lat temu
rodzic
commit
8fb557adc4
2 zmienionych plików z 5 dodań i 5 usunięć
  1. 1 1
      README.md
  2. 4 4
      src/lib/dragger/index.tsx

+ 1 - 1
README.md

@@ -169,6 +169,6 @@ npm run test
 # TODO-LIST
 - [ ] horizontal swaping
 - [x] resizing
-- [ ] touch handle
+- [x] touch handle
 - [ ] responsive layout
 - [ ] SSR/server rendering 

+ 4 - 4
src/lib/dragger/index.tsx

@@ -68,8 +68,8 @@ export class Dragger extends React.Component<DraggerProps, {}> {
 
     constructor(props: DraggerProps) {
         super(props)
-        this.move = this.move.bind(this)
-        this.onDragEnd = this.onDragEnd.bind(this)
+        // this.move = this.move.bind(this)
+        // this.onDragEnd = this.onDragEnd.bind(this)
         this.parent = null;
         this.self = null;
     }
@@ -111,7 +111,7 @@ export class Dragger extends React.Component<DraggerProps, {}> {
 
 
 
-    move(event: any) {
+    move = (event: any) => {
 
         let { lastX, lastY } = this.state
         /*  event.client - this.state.origin 表示的是移动的距离,
@@ -248,7 +248,7 @@ export class Dragger extends React.Component<DraggerProps, {}> {
         })
     }
 
-    onDragEnd(event: any) {
+    onDragEnd = (event: any) => {
         /** 取消用户选择限制,用户可以重新选择 */
         doc.body.style.userSelect = ''
         this.parent = null