From 93e0a945d49d832b3921a84e2119c924397779c3 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 10 Apr 2023 19:05:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E7=9F=A5=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 3 ++- src/notify/index.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/notify/index.js diff --git a/Readme.md b/Readme.md index 0bc6ec7..875a91e 100644 --- a/Readme.md +++ b/Readme.md @@ -36,7 +36,7 @@ - [ ] `wc-cascadar`表单组件-多级联动 - [x] `wc-switch`表单组件-开关 - [x] `wc-icon`图标组件 -- [ ] `wc-layer` 弹层组件 +- [x] `wc-layer` 弹层组件 - [x] `wc-markd`markdown 组件 - [ ] `wc-meditor`md 文本编辑器 - [ ] `wc-neditor`富文本编辑器 @@ -51,6 +51,7 @@ - [ ] `wc-progress`进度条组件 - [ ] `wc-tree`树形菜单组件 - [ ] `wc-uploader`上传组件 +- [ ] `wc-notify`通知组件 ### 测试预览 diff --git a/src/notify/index.js b/src/notify/index.js new file mode 100644 index 0000000..fb0a875 --- /dev/null +++ b/src/notify/index.js @@ -0,0 +1,33 @@ +/** + * {通知组件} + * @author yutent + * @date 2023/04/10 17:17:10 + */ + +import { css, html, Component, bind, styleMap } from '@bd/core' + +class Notify extends Component { + static props = { + title: '', + content: '' + } + + render() { + return html`
` + } +} + +Notify.reg('notify') + +function notify(title = '通知', { icon, body }) { + // + let elem = document.createElement('wc-notify') + + elem.title = title + elem.icon = icon + elem.content = body + + document.body.append(elem) +} + +window.notify = notify