From 5517c249b764be689ea07c5d5d9128b58b836f8e Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 8 Mar 2023 16:31:25 +0800 Subject: [PATCH] update --- src/index.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/index.js b/src/index.js index 2f29c47..5651f2c 100644 --- a/src/index.js +++ b/src/index.js @@ -12,29 +12,16 @@ import { } from './constants.js' import { css, adoptStyles } from './css.js' import { render, html, svg } from './html.js' -import { - $, - $$, - nextTick, - offset, - bind, - unbind, - outsideClick, - clearOutsideClick, - fire -} from './utils.js' - -export { html, css, svg } +import { fire, bind, unbind } from './utils.js' export { $, $$, nextTick, offset, - bind, - unbind, outsideClick, clearOutsideClick -} +} from './utils.js' +export { html, css, svg, bind, unbind } export class Component extends HTMLElement { constructor() { @@ -306,6 +293,10 @@ export class Component extends HTMLElement { return bind(this, type, callback) } + $off(type, callback) { + unbind(this, type, callback) + } + $emit(type, data = {}) { return fire(this, type, data) }