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

Tag \u6807\u7B7E

\n

\u4ECB\u7ECD

\n

\u7528\u4E8E\u6807\u8BB0\u5173\u952E\u8BCD\u548C\u6982\u62EC\u4E3B\u8981\u5185\u5BB9\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 { Tag } from 'vant';\n\nconst app = createApp();\napp.use(Tag);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n

\u901A\u8FC7 type \u5C5E\u6027\u63A7\u5236\u6807\u7B7E\u989C\u8272\u3002

\n
<van-tag type="primary">\u6807\u7B7E</van-tag>\n<van-tag type="success">\u6807\u7B7E</van-tag>\n<van-tag type="danger">\u6807\u7B7E</van-tag>\n<van-tag type="warning">\u6807\u7B7E</van-tag>\n
\n

\u7A7A\u5FC3\u6837\u5F0F

\n

\u8BBE\u7F6E plain \u5C5E\u6027\u8BBE\u7F6E\u4E3A\u7A7A\u5FC3\u6837\u5F0F\u3002

\n
<van-tag plain type="primary">\u6807\u7B7E</van-tag>\n
\n

\u5706\u89D2\u6837\u5F0F

\n

\u901A\u8FC7 round \u8BBE\u7F6E\u4E3A\u5706\u89D2\u6837\u5F0F\u3002

\n
<van-tag round type="primary">\u6807\u7B7E</van-tag>\n
\n

\u6807\u8BB0\u6837\u5F0F

\n

\u901A\u8FC7 mark \u8BBE\u7F6E\u4E3A\u6807\u8BB0\u6837\u5F0F(\u534A\u5706\u89D2)\u3002

\n
<van-tag mark type="primary">\u6807\u7B7E</van-tag>\n
\n

\u53EF\u5173\u95ED\u6807\u7B7E

\n

\u6DFB\u52A0 closeable \u5C5E\u6027\u8868\u793A\u6807\u7B7E\u662F\u53EF\u5173\u95ED\u7684\uFF0C\u5173\u95ED\u6807\u7B7E\u65F6\u4F1A\u89E6\u53D1 close \u4E8B\u4EF6\uFF0C\u5728 close \u4E8B\u4EF6\u4E2D\u53EF\u4EE5\u6267\u884C\u9690\u85CF\u6807\u7B7E\u7684\u903B\u8F91\u3002

\n
<van-tag :show="show" closeable size="medium" type="primary" @close="close">\n  \u6807\u7B7E\n</van-tag>\n
\n
import { ref } from 'vue';\n\nexport default {\n  setup() {\n    const show = ref(true);\n    const close = () => {\n      show.value = false;\n    };\n\n    return {\n      show,\n      close,\n    };\n  },\n};\n
\n

\u6807\u7B7E\u5927\u5C0F

\n

\u901A\u8FC7 size \u5C5E\u6027\u8C03\u6574\u6807\u7B7E\u5927\u5C0F\u3002

\n
<van-tag type="primary">\u6807\u7B7E</van-tag>\n<van-tag type="primary" size="medium">\u6807\u7B7E</van-tag>\n<van-tag type="primary" size="large">\u6807\u7B7E</van-tag>\n
\n

\u81EA\u5B9A\u4E49\u989C\u8272

\n

\u901A\u8FC7 color \u548C text-color \u5C5E\u6027\u8BBE\u7F6E\u6807\u7B7E\u989C\u8272\u3002

\n
<van-tag color="#7232dd">\u6807\u7B7E</van-tag>\n<van-tag color="#ffe1e1" text-color="#ad0000">\u6807\u7B7E</van-tag>\n<van-tag color="#7232dd" plain>\u6807\u7B7E</van-tag>\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
type\u7C7B\u578B\uFF0C\u53EF\u9009\u503C\u4E3A primary success danger warningstringdefault
size\u5927\u5C0F, \u53EF\u9009\u503C\u4E3A large mediumstring-
color\u6807\u7B7E\u989C\u8272string-
show\u662F\u5426\u5C55\u793A\u6807\u7B7Ebooleantrue
plain\u662F\u5426\u4E3A\u7A7A\u5FC3\u6837\u5F0Fbooleanfalse
round\u662F\u5426\u4E3A\u5706\u89D2\u6837\u5F0Fbooleanfalse
mark\u662F\u5426\u4E3A\u6807\u8BB0\u6837\u5F0Fbooleanfalse
text-color\u6587\u672C\u989C\u8272\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E color \u5C5E\u6027stringwhite
closeable\u662F\u5426\u4E3A\u53EF\u5173\u95ED\u6807\u7B7Ebooleanfalse
\n

Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u8BF4\u660E
default\u6807\u7B7E\u663E\u793A\u5185\u5BB9
\n

Events

\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\u65F6\u89E6\u53D1event: MouseEvent
close\u5173\u95ED\u6807\u7B7E\u65F6\u89E6\u53D1event: MouseEvent
\n

\u7C7B\u578B\u5B9A\u4E49

\n

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

\n
import type { TagSize, TagType, TagProps } from 'vant';\n
\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\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-tag-padding0 var(--van-padding-base)-
--van-tag-text-colorvar(--van-white)-
--van-tag-font-sizevar(--van-font-size-sm)-
--van-tag-radius2px-
--van-tag-line-height16px-
--van-tag-medium-padding2px 6px-
--van-tag-large-paddingvar(--van-padding-base) var(--van-padding-xs)-
--van-tag-large-radiusvar(--van-radius-md)-
--van-tag-large-font-sizevar(--van-font-size-md)-
--van-tag-round-radiusvar(--van-radius-max)-
--van-tag-danger-colorvar(--van-danger-color)-
--van-tag-primary-colorvar(--van-primary-color)-
--van-tag-success-colorvar(--van-success-color)-
--van-tag-warning-colorvar(--van-warning-color)-
--van-tag-default-colorvar(--van-gray-6)-
--van-tag-plain-backgroundvar(--van-background-2)-
\n
'},null,8,l))}}}]);