From 3beb578d6b2d61e9963a1b4ca8acdef08c4e9cf3 Mon Sep 17 00:00:00 2001 From: Lindy <33708359+Lindysen@users.noreply.github.com> Date: Tue, 17 Mar 2020 19:21:05 +0800 Subject: [PATCH] feat(SideBar): title slot (#2873) --- example/pages/sidebar/index.wxml | 13 +++++++++++++ example/pages/sidebar/index.wxss | 4 ++++ packages/sidebar-item/index.wxml | 3 ++- packages/sidebar/README.md | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/example/pages/sidebar/index.wxml b/example/pages/sidebar/index.wxml index c1e90a54..6163abff 100644 --- a/example/pages/sidebar/index.wxml +++ b/example/pages/sidebar/index.wxml @@ -13,3 +13,16 @@ + + + + + + + 标签名称 + + + + + + diff --git a/example/pages/sidebar/index.wxss b/example/pages/sidebar/index.wxss index 67dc437e..909c88d2 100644 --- a/example/pages/sidebar/index.wxss +++ b/example/pages/sidebar/index.wxss @@ -5,3 +5,7 @@ page { .custom-sidebar { margin-left: 15px; } + +.custom-sidebar-slot { + --sidebar-width: 100px; +} diff --git a/packages/sidebar-item/index.wxml b/packages/sidebar-item/index.wxml index f68e8644..ab8c6c42 100644 --- a/packages/sidebar-item/index.wxml +++ b/packages/sidebar-item/index.wxml @@ -13,6 +13,7 @@ info="{{ info }}" custom-style="right: 4px" /> - {{ title }} + {{ title }} + diff --git a/packages/sidebar/README.md b/packages/sidebar/README.md index 8055f551..dc409710 100644 --- a/packages/sidebar/README.md +++ b/packages/sidebar/README.md @@ -82,6 +82,12 @@ Page({ | dot | 是否显示右上角小红点 | *boolean* | `false` | - | | info | 提示消息 | *string \| number* | `''` | - | +### SidebarItem Slot + +| 名称 | 说明 | +|-----------|-----------| +| title | 自定义标题栏,如果设置了`title`属性则不生效 | + ### SidebarItem Event | 事件名 | 说明 | 参数 |