增加通知组件

master
yutent 2023-04-10 19:05:00 +08:00
parent 5bfcd2db48
commit 93e0a945d4
2 changed files with 35 additions and 1 deletions

View File

@ -36,7 +36,7 @@
- [ ] `wc-cascadar`表单组件-多级联动 - [ ] `wc-cascadar`表单组件-多级联动
- [x] `wc-switch`表单组件-开关 - [x] `wc-switch`表单组件-开关
- [x] `wc-icon`图标组件 - [x] `wc-icon`图标组件
- [ ] `wc-layer` 弹层组件 - [x] `wc-layer` 弹层组件
- [x] `wc-markd`markdown 组件 - [x] `wc-markd`markdown 组件
- [ ] `wc-meditor`md 文本编辑器 - [ ] `wc-meditor`md 文本编辑器
- [ ] `wc-neditor`富文本编辑器 - [ ] `wc-neditor`富文本编辑器
@ -51,6 +51,7 @@
- [ ] `wc-progress`进度条组件 - [ ] `wc-progress`进度条组件
- [ ] `wc-tree`树形菜单组件 - [ ] `wc-tree`树形菜单组件
- [ ] `wc-uploader`上传组件 - [ ] `wc-uploader`上传组件
- [ ] `wc-notify`通知组件
### 测试预览 ### 测试预览

33
src/notify/index.js Normal file
View File

@ -0,0 +1,33 @@
/**
* {通知组件}
* @author yutent<yutent.io@gmail.com>
* @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` <div class="notification"></div> `
}
}
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