From fea0a5773c37ccd5f3f4067d19f06da0db8f52cd Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 12 Apr 2023 18:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme,=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=8D=A1=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 7 ++++--- package.json | 2 +- src/tabs/index.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 src/tabs/index.js diff --git a/Readme.md b/Readme.md index 47a2d52..778a411 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ -# @bd/wcui +# @bd/ui -百搭 WCUI 组件库, 基于 web components 开发。面向下一代的 UI 组件库 +百搭 UI 组件库, 基于 web components 开发。面向下一代的 UI 组件库 ### 开发环境 @@ -53,7 +53,8 @@ - [ ] `wc-progress`进度条组件 - [ ] `wc-tree`树形菜单组件 - [ ] `wc-uploader`上传组件 -- [ ] `wc-notify`通知组件 +- [x] `wc-notify`通知组件 +- [ ] `wc-tabs`选项卡组件 ### 测试预览 diff --git a/package.json b/package.json index 618f3e3..2a53056 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bd/ui", - "version": "1.0.0", + "version": "0.0.1", "description": "", "files": [ "dist/*" diff --git a/src/tabs/index.js b/src/tabs/index.js new file mode 100644 index 0000000..244be71 --- /dev/null +++ b/src/tabs/index.js @@ -0,0 +1,44 @@ +/** + * {选项卡组件} + * @author yutent + * @date 2023/03/06 15:17:25 + */ + +import { css, html, bind, Component } from '@bd/core' + +class Tabs extends Component { + render() { + return html` +

+ 父组件内容 + dsds +

+ + ` + } + + created() { + console.log(this.root) + bind(this.root, 'slotchange', ev => { + let children = ev.target.assignedNodes() + + children.forEach(it => { + let slot = it.querySelector('[slot=label]') + this.$refs.label.append( + slot.cloneNode(true), + this.$refs.label.firstChild + ) + slot.remove() + }) + }) + } +} + +class Tab extends Component { + render() { + return html`
这是卡片内部
` + } +} + +Tabs.reg('tabs') +Tab.reg('tab')