diff --git a/package/component/src/component/progress/index.less b/package/component/src/component/progress/index.less index 9f883799..682567ae 100644 --- a/package/component/src/component/progress/index.less +++ b/package/component/src/component/progress/index.less @@ -38,16 +38,36 @@ padding: 0 10px; color: #fff; } -.lay-progress-circle { +.lay-progress-circle-container { position: relative; display: inline-block; - width: 120px; - height: 120px; - text-align: center; } + +.lay-progress-circle, +.lay-progress-circle-bg { + width: 150px; + height: 150px; + position: relative; + border-radius: 50%; + -webkit-mask: radial-gradient(transparent 69px, #000 45px); +} + +.lay-progress-circle-bg { + background-color: var(--global-neutral-color-3); +} + .lay-progress-circle__text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); -} \ No newline at end of file +} + +.lay-progress-circle-corner { + position: absolute; + width: 6px; + height: 6px; + border-radius: 50%; + top: 72px; + left: 72px; +} diff --git a/package/component/src/component/progress/index.vue b/package/component/src/component/progress/index.vue index c4ab6913..45c379ec 100644 --- a/package/component/src/component/progress/index.vue +++ b/package/component/src/component/progress/index.vue @@ -29,16 +29,6 @@ const styles = computed(() => { ]; }); -const getStrokeDasharray = computed(() => { - let percent; - if (typeof props.percent == "string") { - percent = parseInt(props.percent); - } else { - percent = props.percent; - } - return `${percent * 31.4}` + "px 3140px"; -}); - const getCircleColor = computed(() => { let color; switch (props.theme) { @@ -64,36 +54,56 @@ const getCircleColor = computed(() => { color = "#fafafa"; break; default: - color = "var(--global-checked-color)"; + color = "#5FB878"; break; } color = props.color ? props.color : color; return color; }); + +const getCircleRotate = computed(() => { + let percent; + if (typeof props.percent == "string") { + percent = parseInt(props.percent); + } else { + percent = props.percent; + } + return (percent / 100) * 360; +});