/*! For license information please see 793.c19a6a88.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["793"],{92877: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:'
\u5706\u73AF\u5F62\u7684\u8FDB\u5EA6\u6761\u7EC4\u4EF6\uFF0C\u652F\u6301\u8FDB\u5EA6\u6E10\u53D8\u52A8\u753B\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 { Circle } from 'vant';\n\nconst app = createApp();\napp.use(Circle);\n
\nrate
\u5C5E\u6027\u8868\u793A\u8FDB\u5EA6\u6761\u7684\u76EE\u6807\u8FDB\u5EA6\uFF0Cv-model:current-rate
\u8868\u793A\u52A8\u753B\u8FC7\u7A0B\u4E2D\u7684\u5B9E\u65F6\u8FDB\u5EA6\u3002\u5F53 rate
\u53D1\u751F\u53D8\u5316\u65F6\uFF0Cv-model:current-rate
\u4F1A\u4EE5 speed
\u7684\u901F\u5EA6\u53D8\u5316\uFF0C\u76F4\u81F3\u8FBE\u5230 rate
\u8BBE\u5B9A\u7684\u503C\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="30"\n :speed="100"\n :text="text"\n/>\n
\nimport { ref, computed } from 'vue';\n\nexport default {\n setup() {\n const currentRate = ref(0);\n const text = computed(() => currentRate.value.toFixed(0) + '%');\n\n return {\n text,\n currentRate,\n };\n },\n};\n
\n\u901A\u8FC7 stroke-width
\u5C5E\u6027\u6765\u63A7\u5236\u8FDB\u5EA6\u6761\u5BBD\u5EA6\uFF0Cstroke-width
\u6307\u7684\u662F SVG \u4E2D path
\u7684\u5BBD\u5EA6\uFF0C\u9ED8\u8BA4\u503C\u4E3A 40
\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n :stroke-width="60"\n text="\u5BBD\u5EA6\u5B9A\u5236"\n/>\n
\nstroke-width
\u7684\u5355\u4F4D\u4E0D\u662F px
\uFF0C\u5982\u679C\u4F60\u60F3\u77E5\u9053 stroke-width
\u4E0E px
\u7684\u6362\u7B97\u5173\u7CFB\uFF0C\u53EF\u4EE5\u901A\u8FC7\u5982\u4E0B\u516C\u5F0F\u8BA1\u7B97\uFF1A
// SVG \u7684 viewBox \u5927\u5C0F\nconst viewBox = 1000 + strokeWidth;\n\n// Circle \u7EC4\u4EF6\u7684\u5BBD\u5EA6\uFF0C\u9ED8\u8BA4\u4E3A 100px\nconst circleWidth = 100;\n\n// \u6700\u7EC8\u6E32\u67D3\u51FA\u6765\u7684\u8FDB\u5EA6\u6761\u5BBD\u5EA6\uFF08px\uFF09\nconst pxWidth = (strokeWidth * circleWidth) / viewBox;\n
\n\u901A\u8FC7 color
\u5C5E\u6027\u6765\u63A7\u5236\u8FDB\u5EA6\u6761\u989C\u8272\uFF0Clayer-color
\u5C5E\u6027\u6765\u63A7\u5236\u8F68\u9053\u989C\u8272\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n layer-color="#ebedf0"\n text="\u989C\u8272\u5B9A\u5236"\n/>\n
\ncolor
\u5C5E\u6027\u652F\u6301\u4F20\u5165\u5BF9\u8C61\u683C\u5F0F\u6765\u5B9A\u4E49\u6E10\u53D8\u8272\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n :color="gradientColor"\n text="\u6E10\u53D8\u8272"\n/>\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const currentRate = ref(0);\n const gradientColor = {\n '0%': '#3fecff',\n '100%': '#6149f6',\n };\n\n return {\n currentRate,\n gradientColor,\n };\n },\n};\n
\n\u5C06 clockwise
\u8BBE\u7F6E\u4E3A false
\uFF0C\u8FDB\u5EA6\u4F1A\u4ECE\u9006\u65F6\u9488\u65B9\u5411\u5F00\u59CB\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n :clockwise="false"\n text="\u9006\u65F6\u9488\u65B9\u5411"\n/>\n
\n\u901A\u8FC7 size
\u5C5E\u6027\u8BBE\u7F6E\u5706\u73AF\u76F4\u5F84\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n size="120px"\n text="\u5927\u5C0F\u5B9A\u5236"\n/>\n
\n\u8FDB\u5EA6\u6761\u9ED8\u8BA4\u4ECE\u9876\u90E8\u5F00\u59CB\uFF0C\u53EF\u4EE5\u901A\u8FC7 start-position
\u5C5E\u6027\u8BBE\u7F6E\u8D77\u59CB\u4F4D\u7F6E\u3002
<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n text="\u5DE6\u4FA7"\n start-position="left"\n/>\n<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n text="\u53F3\u4FA7"\n start-position="right"\n/>\n<van-circle\n v-model:current-rate="currentRate"\n :rate="rate"\n text="\u5E95\u90E8"\n start-position="bottom"\n/>\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
v-model:current-rate | \n\u5F53\u524D\u8FDB\u5EA6 | \nnumber | \n- | \n
rate | \n\u76EE\u6807\u8FDB\u5EA6 | \nnumber | string | \n100 | \n
size | \n\u5706\u73AF\u76F4\u5F84\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3A px | \nnumber | string | \n100px | \n
color | \n\u8FDB\u5EA6\u6761\u989C\u8272\uFF0C\u4F20\u5165\u5BF9\u8C61\u683C\u5F0F\u53EF\u4EE5\u5B9A\u4E49\u6E10\u53D8\u8272 | \nstring | object | \n#1989fa | \n
layer-color | \n\u8F68\u9053\u989C\u8272 | \nstring | \nwhite | \n
fill | \n\u586B\u5145\u989C\u8272 | \nstring | \nnone | \n
speed | \n\u52A8\u753B\u901F\u5EA6\uFF08\u5355\u4F4D\u4E3A rate/s\uFF09 | \nnumber | string | \n0 | \n
text | \n\u6587\u5B57 | \nstring | \n- | \n
stroke-width | \n\u8FDB\u5EA6\u6761\u5BBD\u5EA6 | \nnumber | string | \n40 | \n
stroke-linecap | \n\u8FDB\u5EA6\u6761\u7AEF\u70B9\u7684\u5F62\u72B6\uFF0C\u53EF\u9009\u503C\u4E3A square butt | \nstring | \nround | \n
clockwise | \n\u662F\u5426\u987A\u65F6\u9488\u589E\u52A0 | \nboolean | \ntrue | \n
start-position | \n\u8FDB\u5EA6\u8D77\u59CB\u4F4D\u7F6E\uFF0C\u53EF\u9009\u503C\u4E3A left \u3001right \u3001bottom | \nCircleStartPosition | \ntop | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u81EA\u5B9A\u4E49\u6587\u5B57\u5185\u5BB9 | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { CircleProps, CircleStartPosition } 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-circle-size | \n100px | \n- | \n
--van-circle-color | \nvar(--van-primary-color) | \n- | \n
--van-circle-layer-color | \nvar(--van-white) | \n- | \n
--van-circle-text-color | \nvar(--van-text-color) | \n- | \n
--van-circle-text-font-weight | \nvar(--van-font-bold) | \n- | \n
--van-circle-text-font-size | \nvar(--van-font-size-md) | \n- | \n
--van-circle-text-line-height | \nvar(--van-line-height-md) | \n- | \n