/*! For license information please see 1542.0c273ed5.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["1542"],{96503:function(s,n,a){"use strict";a.r(n);var t=a("80681");let e=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u7528\u4E8E\u5BF9\u4E8B\u7269\u8FDB\u884C\u8BC4\u7EA7\u64CD\u4F5C\u3002
\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
\nimport { createApp } from 'vue';\nimport { Rate } from 'vant';\n\nconst app = createApp();\napp.use(Rate);\n
\n\u901A\u8FC7 v-model
\u6765\u7ED1\u5B9A\u5F53\u524D\u8BC4\u5206\u503C\u3002
<van-rate v-model="value" />\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const value = ref(3);\n return { value };\n },\n};\n
\n\u901A\u8FC7 icon
\u5C5E\u6027\u8BBE\u7F6E\u9009\u4E2D\u65F6\u7684\u56FE\u6807\uFF0Cvoid-icon
\u5C5E\u6027\u8BBE\u7F6E\u672A\u9009\u4E2D\u65F6\u7684\u56FE\u6807\u3002
<van-rate v-model="value" icon="like" void-icon="like-o" />\n
\n\u901A\u8FC7 size
\u5C5E\u6027\u8BBE\u7F6E\u56FE\u6807\u5927\u5C0F\uFF0Ccolor
\u5C5E\u6027\u8BBE\u7F6E\u9009\u4E2D\u65F6\u7684\u989C\u8272\uFF0Cvoid-color
\u8BBE\u7F6E\u672A\u9009\u4E2D\u65F6\u7684\u989C\u8272\u3002
<van-rate\n v-model="value"\n :size="25"\n color="#ffd21e"\n void-icon="star"\n void-color="#eee"\n/>\n
\n\u8BBE\u7F6E allow-half
\u5C5E\u6027\u540E\u53EF\u4EE5\u9009\u4E2D\u534A\u661F\u3002
<van-rate v-model="value" allow-half />\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const value = ref(2.5);\n return { value };\n },\n};\n
\n\u901A\u8FC7 count
\u5C5E\u6027\u8BBE\u7F6E\u8BC4\u5206\u603B\u6570\u3002
<van-rate v-model="value" :count="6" />\n
\n\u5F53 clearable
\u5C5E\u6027\u8BBE\u7F6E\u4E3A true
\uFF0C\u518D\u6B21\u70B9\u51FB\u76F8\u540C\u7684\u503C\u65F6\uFF0C\u53EF\u4EE5\u5C06\u503C\u91CD\u7F6E\u4E3A 0
\u3002
<van-rate v-model="value" clearable />\n
\n\u901A\u8FC7 disabled
\u5C5E\u6027\u6765\u7981\u7528\u8BC4\u5206\u3002
<van-rate v-model="value" disabled />\n
\n\u901A\u8FC7 readonly
\u5C5E\u6027\u5C06\u8BC4\u5206\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u72B6\u6001\u3002
<van-rate v-model="value" readonly />\n
\n\u8BBE\u7F6E readonly
\u548C allow-half
\u5C5E\u6027\u540E\uFF0CRate \u7EC4\u4EF6\u53EF\u4EE5\u5C55\u793A\u4EFB\u610F\u5C0F\u6570\u7ED3\u679C\u3002
<van-rate v-model="value" readonly allow-half />\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const value = ref(3.3);\n return { value };\n },\n};\n
\n\u8BC4\u5206\u53D8\u5316\u65F6\uFF0C\u4F1A\u89E6\u53D1 change
\u4E8B\u4EF6\u3002
<van-rate v-model="value" @change="onChange" />\n
\nimport { ref } from 'vue';\nimport { showToast } from 'vant';\n\nexport default {\n setup() {\n const value = ref(3);\n const onChange = (value) => showToast('\u5F53\u524D\u503C\uFF1A' + value);\n return {\n value,\n onChange,\n };\n },\n};\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
v-model | \n\u5F53\u524D\u5206\u503C | \nnumber | \n- | \n
count | \n\u56FE\u6807\u603B\u6570 | \nnumber | string | \n5 | \n
size | \n\u56FE\u6807\u5927\u5C0F\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3Apx | \nnumber | string | \n20px | \n
gutter | \n\u56FE\u6807\u95F4\u8DDD\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3Apx | \nnumber | string | \n4px | \n
color | \n\u9009\u4E2D\u65F6\u7684\u989C\u8272 | \nstring | \n#ee0a24 | \n
void-color | \n\u672A\u9009\u4E2D\u65F6\u7684\u989C\u8272 | \nstring | \n#c8c9cc | \n
disabled-color | \n\u7981\u7528\u65F6\u7684\u989C\u8272 | \nstring | \n#c8c9cc | \n
icon | \n\u9009\u4E2D\u65F6\u7684\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027 | \nstring | \nstar | \n
void-icon | \n\u672A\u9009\u4E2D\u65F6\u7684\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027 | \nstring | \nstar-o | \n
icon-prefix | \n\u56FE\u6807\u7C7B\u540D\u524D\u7F00\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 class-prefix \u5C5E\u6027 | \nstring | \nvan-icon | \n
allow-half | \n\u662F\u5426\u5141\u8BB8\u534A\u9009 | \nboolean | \nfalse | \n
clearable v4.6.0 | \n\u662F\u5426\u5141\u8BB8\u518D\u6B21\u70B9\u51FB\u540E\u6E05\u9664 | \nboolean | \nfalse | \n
readonly | \n\u662F\u5426\u4E3A\u53EA\u8BFB\u72B6\u6001\uFF0C\u53EA\u8BFB\u72B6\u6001\u4E0B\u65E0\u6CD5\u4FEE\u6539\u8BC4\u5206 | \nboolean | \nfalse | \n
disabled | \n\u662F\u5426\u7981\u7528\u8BC4\u5206 | \nboolean | \nfalse | \n
touchable | \n\u662F\u5426\u53EF\u4EE5\u901A\u8FC7\u6ED1\u52A8\u624B\u52BF\u9009\u62E9\u8BC4\u5206 | \nboolean | \ntrue | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
change | \n\u5F53\u524D\u5206\u503C\u53D8\u5316\u65F6\u89E6\u53D1\u7684\u4E8B\u4EF6 | \ncurrentValue: number | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { RateProps } from 'vant';\n
\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\u540D\u79F0 | \n\u9ED8\u8BA4\u503C | \n\u63CF\u8FF0 | \n
---|---|---|
--van-rate-icon-size | \n20px | \n- | \n
--van-rate-icon-gutter | \nvar(--van-padding-base) | \n- | \n
--van-rate-icon-void-color | \nvar(--van-gray-5) | \n- | \n
--van-rate-icon-full-color | \nvar(--van-danger-color) | \n- | \n
--van-rate-icon-disabled-color | \nvar(--van-gray-5) | \n- | \n