From 6eb8c4a076324c613f9f608837bcfa898552dc2f Mon Sep 17 00:00:00 2001 From: anlyyao Date: Wed, 20 Apr 2022 10:07:00 +0800 Subject: [PATCH] feat(notice-bar): add prefix-icon and content trigger --- example/pages/notice-bar/notice-bar.ts | 8 ++++++++ example/pages/notice-bar/notice-bar.wxml | 2 ++ src/notice-bar/README.md | 25 ++++++++++++------------ src/notice-bar/notice-bar.ts | 8 ++++++++ src/notice-bar/notice-bar.wxml | 4 ++-- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/example/pages/notice-bar/notice-bar.ts b/example/pages/notice-bar/notice-bar.ts index 0cace666a..fd9a4348e 100644 --- a/example/pages/notice-bar/notice-bar.ts +++ b/example/pages/notice-bar/notice-bar.ts @@ -24,6 +24,14 @@ Page({ console.log('click extre text', e); }, + handlePrefixIcon(e) { + console.log('click prefix-icon close', e); + }, + + handleContent(e) { + console.log('click content', e); + }, + handleSuffixIconCloseDemo(e) { console.log('click suffix-icon close', e); this.setData({ diff --git a/example/pages/notice-bar/notice-bar.wxml b/example/pages/notice-bar/notice-bar.wxml index 5958513ed..e454c3a30 100644 --- a/example/pages/notice-bar/notice-bar.wxml +++ b/example/pages/notice-bar/notice-bar.wxml @@ -21,6 +21,8 @@ visible="{{true}}" suffixIcon="chevron-right" content="提示文字描述提示文字描述提示文字描述" + bind:prefix-icon="handlePrefixIcon" + bind:content="handleContent" bind:suffix-icon="handleSuffixIconLink" /> diff --git a/src/notice-bar/README.md b/src/notice-bar/README.md index c78ef8e16..456d89c3d 100644 --- a/src/notice-bar/README.md +++ b/src/notice-bar/README.md @@ -24,7 +24,7 @@ isComponent: true ### 带图标静态公告栏 ```xml - + @@ -38,8 +38,10 @@ isComponent: true visible="{{true}}" suffixIcon="chevron-right" content="提示文字描述提示文字描述提示文字描述" + bind:prefix-icon="handlePrefixIcon" + bind:content="handleContent" bind:suffix-icon="handleSuffixIconLink" -> +/> - + - +