diff --git a/src/card/index.wc b/src/card/index.wc
new file mode 100644
index 0000000..fd7bf0f
--- /dev/null
+++ b/src/card/index.wc
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
diff --git a/src/color/index.wc b/src/color/index.wc
index 510784e..81123d3 100644
--- a/src/color/index.wc
+++ b/src/color/index.wc
@@ -375,7 +375,7 @@ export default class Color {
this.__PREVIEW__.style.backgroundColor = this.__INPUT__.value
this.__ALPHA_BAR__.style.background = alphaColor
this._moveSceneThumb(x, y)
- this.dispatchEvent(new CustomEvent('input'))
+ $.fire(this, 'input')
}
get value() {
@@ -501,14 +501,14 @@ export default class Color {
this.__PREVIEW__.style = ''
this.props.value = this.__INPUT__.value
delete this._tmpval
- this.dispatchEvent(new CustomEvent('input'))
+ $.fire(this, 'input')
})
this._pickedFn = $.bind(this.__PICKED__, 'click', ev => {
this.__PANEL__.style.display = ''
this.__PREVIEW__.style.backgroundColor = this.__INPUT__.value
this.props.value = this.__INPUT__.value
delete this._tmpval
- this.dispatchEvent(new CustomEvent('input'))
+ $.fire(this, 'input')
})
// 点击外部区别时,还原之前的颜色值
diff --git a/src/drag/core.js b/src/drag/core.js
index b148980..d720707 100644
--- a/src/drag/core.js
+++ b/src/drag/core.js
@@ -103,32 +103,25 @@ export default class Drag {
}
this.pos._x = _x
this.pos._y = _y
- this.$elem.dispatchEvent(
- new CustomEvent('dragging', {
- detail: {
- offset: {
- x: this.pos.x + _x,
- y: this.pos.y + _y
- },
- move: { x: _x, y: _y }
- }
- })
- )
+ $.fire(this.$elem, 'dragging', {
+ offset: {
+ x: this.pos.x + _x,
+ y: this.pos.y + _y
+ },
+ moved: { x: _x, y: _y }
+ })
this.$elem.style.transform = `translate(${_x}px, ${_y}px)`
})
let handleUp = $.bind(document, 'mouseup', ev => {
- this.$elem.dispatchEvent(
- new CustomEvent('dragged', {
- detail: {
- offset: {
- x: this.pos.x + this.pos._x,
- y: this.pos.y + this.pos._y
- },
- move: { x: this.pos._x, y: this.pos._y }
- }
- })
- )
+ $.fire(this.$elem, 'dragged', {
+ offset: {
+ x: this.pos.x + this.pos._x,
+ y: this.pos.y + this.pos._y
+ },
+ moved: { x: this.pos._x, y: this.pos._y }
+ })
+
$.unbind(document, 'mousemove', handleMove)
$.unbind(document, 'mouseup', handleUp)
})
diff --git a/src/drag/doc.md b/src/drag/doc.md
deleted file mode 100644
index 0cd4766..0000000
--- a/src/drag/doc.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# 拖拽插件
-> 该插件可以让任意一个元素可以被拖拽,而不需要该元素是否具有定位属性。
-> 使用时,在目标元素上添加`:drag`属性即可以实现拖拽功能。
-
-## 依赖
-> 依赖`Anot`框架
-
-## 浏览器兼容性
-+ chrome
-+ firefox
-+ safari
-+ IE10+
-
-
-## 用法
-> 只需要在要拖拽的元素上添加`:drag`即可;
-> 如果要拖拽的元素不是当前元素,只需要给该属性增加一个值为想要拖拽元素的类名或ID。
-> 具体请看示例:
-> **注意:** `拖拽的元素不是本身时,只会往父级一级一级找相匹配的`
-
-```html
-
-
-
-
+
+