/*! For license information please see 3833.7a49729a.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["3833"],{75803:function(n,s,a){"use strict";a.r(s);var t=a("80681");let l=["innerHTML"];s.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

NoticeBar \u901A\u77E5\u680F

\n

\u4ECB\u7ECD

\n

\u7528\u4E8E\u5FAA\u73AF\u64AD\u653E\u5C55\u793A\u4E00\u7EC4\u6D88\u606F\u901A\u77E5\u3002

\n

\u5F15\u5165

\n

\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002

\n
import { createApp } from 'vue';\nimport { NoticeBar } from 'vant';\n\nconst app = createApp();\napp.use(NoticeBar);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n

\u901A\u8FC7 text \u5C5E\u6027\u8BBE\u7F6E\u901A\u77E5\u680F\u7684\u5185\u5BB9\uFF0C\u901A\u8FC7 left-icon \u5C5E\u6027\u8BBE\u7F6E\u901A\u77E5\u680F\u5DE6\u4FA7\u7684\u56FE\u6807\u3002

\n
<van-notice-bar\n  left-icon="volume-o"\n  text="\u65E0\u8BBA\u6211\u4EEC\u80FD\u6D3B\u591A\u4E45\uFF0C\u6211\u4EEC\u80FD\u591F\u4EAB\u53D7\u7684\u53EA\u6709\u65E0\u6CD5\u5206\u5272\u7684\u6B64\u523B\uFF0C\u6B64\u5916\u522B\u65E0\u5176\u4ED6\u3002"\n/>\n
\n

\u6EDA\u52A8\u64AD\u653E

\n

\u901A\u77E5\u680F\u7684\u5185\u5BB9\u957F\u5EA6\u6EA2\u51FA\u65F6\u4F1A\u81EA\u52A8\u5F00\u542F\u6EDA\u52A8\u64AD\u653E\uFF0C\u901A\u8FC7 scrollable \u5C5E\u6027\u53EF\u4EE5\u63A7\u5236\u8BE5\u884C\u4E3A\u3002

\n
<!-- \u6587\u5B57\u8F83\u77ED\u65F6\uFF0C\u901A\u8FC7\u8BBE\u7F6E scrollable \u5C5E\u6027\u5F00\u542F\u6EDA\u52A8\u64AD\u653E -->\n<van-notice-bar scrollable text="\u7C73\u888B\u867D\u7A7A\u2014\u2014\u6A31\u82B1\u5F00\u54C9\uFF01" />\n\n<!-- \u6587\u5B57\u8F83\u957F\u65F6\uFF0C\u901A\u8FC7\u7981\u7528 scrollable \u5C5E\u6027\u5173\u95ED\u6EDA\u52A8\u64AD\u653E -->\n<van-notice-bar\n  :scrollable="false"\n  text="\u4E0D\u4F1A\u56DE\u5934\u7684\u4E1C\u897F\u6709\u56DB\u4EF6\uFF1A\u8BF4\u51FA\u53E3\u7684\u8BDD\u3001\u79BB\u5F26\u7684\u7BAD\u3001\u901D\u53BB\u7684\u751F\u6D3B\u548C\u5931\u53BB\u7684\u673A\u4F1A\u3002"\n/>\n
\n

\u591A\u884C\u5C55\u793A

\n

\u6587\u5B57\u8F83\u957F\u65F6\uFF0C\u53EF\u4EE5\u901A\u8FC7\u8BBE\u7F6E wrapable \u5C5E\u6027\u6765\u5F00\u542F\u591A\u884C\u5C55\u793A\u3002

\n
<van-notice-bar\n  wrapable\n  :scrollable="false"\n  text="\u4E0D\u4F1A\u56DE\u5934\u7684\u4E1C\u897F\u6709\u56DB\u4EF6\uFF1A\u8BF4\u51FA\u53E3\u7684\u8BDD\u3001\u79BB\u5F26\u7684\u7BAD\u3001\u901D\u53BB\u7684\u751F\u6D3B\u548C\u5931\u53BB\u7684\u673A\u4F1A\u3002"\n/>\n
\n

\u901A\u77E5\u680F\u6A21\u5F0F

\n

\u901A\u77E5\u680F\u652F\u6301 closeable \u548C link \u4E24\u79CD\u6A21\u5F0F\u3002

\n
<!-- closeable \u6A21\u5F0F\uFF0C\u5728\u53F3\u4FA7\u663E\u793A\u5173\u95ED\u6309\u94AE -->\n<van-notice-bar mode="closeable">\u7C73\u888B\u867D\u7A7A\u2014\u2014\u6A31\u82B1\u5F00\u54C9\uFF01</van-notice-bar>\n\n<!-- link \u6A21\u5F0F\uFF0C\u5728\u53F3\u4FA7\u663E\u793A\u94FE\u63A5\u7BAD\u5934 -->\n<van-notice-bar mode="link">\u7C73\u888B\u867D\u7A7A\u2014\u2014\u6A31\u82B1\u5F00\u54C9\uFF01</van-notice-bar>\n
\n

\u81EA\u5B9A\u4E49\u6837\u5F0F

\n

\u901A\u8FC7 color \u5C5E\u6027\u8BBE\u7F6E\u6587\u672C\u989C\u8272\uFF0C\u901A\u8FC7 background \u5C5E\u6027\u8BBE\u7F6E\u80CC\u666F\u8272\u3002

\n
<van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o">\n  \u7C73\u888B\u867D\u7A7A\u2014\u2014\u6A31\u82B1\u5F00\u54C9\uFF01\n</van-notice-bar>\n
\n

\u5782\u76F4\u6EDA\u52A8

\n

\u642D\u914D NoticeBar \u548C Swipe \u7EC4\u4EF6\uFF0C\u53EF\u4EE5\u5B9E\u73B0\u5782\u76F4\u6EDA\u52A8\u7684\u6548\u679C\u3002

\n
<van-notice-bar left-icon="volume-o" :scrollable="false">\n  <van-swipe\n    vertical\n    class="notice-swipe"\n    :autoplay="3000"\n    :touchable="false"\n    :show-indicators="false"\n  >\n    <van-swipe-item>\u660E\u6708\u76F4\u5165\uFF0C\u65E0\u5FC3\u53EF\u731C\u3002</van-swipe-item>\n    <van-swipe-item>\u4ED9\u4EBA\u629A\u6211\u9876\uFF0C\u7ED3\u53D1\u53D7\u957F\u751F\u3002</van-swipe-item>\n    <van-swipe-item>\u4ECA\u4EBA\u4E0D\u89C1\u53E4\u65F6\u6708\uFF0C\u4ECA\u6708\u66FE\u7ECF\u7167\u53E4\u4EBA\u3002</van-swipe-item>\n  </van-swipe>\n</van-notice-bar>\n\n<style>\n  .notice-swipe {\n    height: 40px;\n    line-height: 40px;\n  }\n</style>\n
\n

API

\n

Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
mode\u901A\u77E5\u680F\u6A21\u5F0F\uFF0C\u53EF\u9009\u503C\u4E3A closeable linkstring\'\'
text\u901A\u77E5\u6587\u672C\u5185\u5BB9string\'\'
color\u901A\u77E5\u6587\u672C\u989C\u8272string#ed6a0c
background\u6EDA\u52A8\u6761\u80CC\u666Fstring#fffbe8
left-icon\u5DE6\u4FA7\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027string-
delay\u52A8\u753B\u5EF6\u8FDF\u65F6\u95F4 (s)number | string1
speed\u6EDA\u52A8\u901F\u7387 (px/s)number | string60
scrollable\u662F\u5426\u5F00\u542F\u6EDA\u52A8\u64AD\u653E\uFF0C\u5185\u5BB9\u957F\u5EA6\u6EA2\u51FA\u65F6\u9ED8\u8BA4\u5F00\u542Fboolean-
wrapable\u662F\u5426\u5F00\u542F\u6587\u672C\u6362\u884C\uFF0C\u53EA\u5728\u7981\u7528\u6EDA\u52A8\u65F6\u751F\u6548booleanfalse
\n

Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u4E8B\u4EF6\u540D\u8BF4\u660E\u56DE\u8C03\u53C2\u6570
click\u70B9\u51FB\u901A\u77E5\u680F\u65F6\u89E6\u53D1event: MouseEvent
close\u5173\u95ED\u901A\u77E5\u680F\u65F6\u89E6\u53D1event: MouseEvent
replay\u6BCF\u5F53\u6EDA\u52A8\u680F\u91CD\u65B0\u5F00\u59CB\u6EDA\u52A8\u65F6\u89E6\u53D1-
\n

\u65B9\u6CD5

\n

\u901A\u8FC7 ref \u53EF\u4EE5\u83B7\u53D6\u5230 NoticeBar \u5B9E\u4F8B\u5E76\u8C03\u7528\u5B9E\u4F8B\u65B9\u6CD5\uFF0C\u8BE6\u89C1\u7EC4\u4EF6\u5B9E\u4F8B\u65B9\u6CD5\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u65B9\u6CD5\u540D\u8BF4\u660E\u53C2\u6570\u8FD4\u56DE\u503C
reset\u91CD\u7F6E\u901A\u77E5\u680F\u5230\u521D\u59CB\u72B6\u6001--
\n

\u7C7B\u578B\u5B9A\u4E49

\n

\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A

\n
import type { NoticeBarMode, NoticeBarProps, NoticeBarInstance } from 'vant';\n
\n

NoticeBarInstance \u662F\u7EC4\u4EF6\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u7528\u6CD5\u5982\u4E0B\uFF1A

\n
import { ref } from 'vue';\nimport type { NoticeBarInstance } from 'vant';\n\nconst noticeBarRef = ref<NoticeBarInstance>();\n\nnoticeBarRef.value?.reset();\n
\n

Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u5185\u5BB9
default\u901A\u77E5\u6587\u672C\u5185\u5BB9
left-icon\u81EA\u5B9A\u4E49\u5DE6\u4FA7\u56FE\u6807
right-icon\u81EA\u5B9A\u4E49\u53F3\u4FA7\u56FE\u6807
\n

\u4E3B\u9898\u5B9A\u5236

\n

\u6837\u5F0F\u53D8\u91CF

\n

\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-notice-bar-height40px-
--van-notice-bar-padding0 var(--van-padding-md)-
--van-notice-bar-wrapable-paddingvar(--van-padding-xs) var(--van-padding-md)-
--van-notice-bar-text-colorvar(--van-orange-dark)-
--van-notice-bar-font-sizevar(--van-font-size-md)-
--van-notice-bar-line-height24px-
--van-notice-bar-backgroundvar(--van-orange-light)-
--van-notice-bar-icon-size16px-
--van-notice-bar-icon-min-width24px-
\n
'},null,8,l))}}}]);