diff --git a/src/button/index.tsx b/src/button/index.tsx index 738f9b84a..b130f3fe4 100644 --- a/src/button/index.tsx +++ b/src/button/index.tsx @@ -1,4 +1,4 @@ -import { PropType, CSSProperties } from 'vue'; +import { PropType, CSSProperties, ButtonHTMLAttributes } from 'vue'; // Utils import { createNamespace } from '../utils'; @@ -49,7 +49,7 @@ export default createComponent({ default: 'normal', }, nativeType: { - type: String, + type: String as PropType, default: 'button', }, loadingSize: { diff --git a/src/card/index.tsx b/src/card/index.tsx index 28f851f20..433333748 100644 --- a/src/card/index.tsx +++ b/src/card/index.tsx @@ -10,14 +10,14 @@ const [createComponent, bem] = createNamespace('card'); export default createComponent({ props: { tag: String, + num: [Number, String], desc: String, thumb: String, title: String, + price: [Number, String], centered: Boolean, lazyLoad: Boolean, thumbLink: String, - num: [Number, String], - price: [Number, String], originPrice: [Number, String], currency: { type: String, diff --git a/src/cell/index.tsx b/src/cell/index.tsx index f299a2c32..a73ce8c0d 100644 --- a/src/cell/index.tsx +++ b/src/cell/index.tsx @@ -74,10 +74,10 @@ export default createComponent({ }; const renderValue = () => { - const hasTitle = slots.title || isDef(props.title); const hasValue = slots.default || isDef(props.value); if (hasValue) { + const hasTitle = slots.title || isDef(props.title); return (
{slots.default ? slots.default() : {props.value}} diff --git a/src/circle/index.tsx b/src/circle/index.tsx index af8d24388..d4df3e205 100644 --- a/src/circle/index.tsx +++ b/src/circle/index.tsx @@ -1,4 +1,4 @@ -import { watch, computed, PropType } from 'vue'; +import { watch, computed, PropType, CSSProperties } from 'vue'; import { raf, cancelRaf } from '@vant/use'; import { isObject, getSizeStyle, createNamespace } from '../utils'; @@ -62,7 +62,8 @@ export default createComponent({ watch( () => props.rate, (rate) => { - let rafId; + let rafId: number | undefined; + const startTime = Date.now(); const startRate = props.currentRate; const endRate = format(rate); @@ -97,11 +98,11 @@ export default createComponent({ const renderHover = () => { const PERIMETER = 3140; const { strokeWidth, currentRate, strokeLinecap } = props; - let { color } = props; const offset = (PERIMETER * currentRate) / 100; - color = isObject(color) ? `url(#${id})` : color; - const style = { - stroke: `${color}`, + const color = isObject(props.color) ? `url(#${id})` : props.color; + + const style: CSSProperties = { + stroke: color, strokeWidth: `${+strokeWidth + 1}px`, strokeLinecap, strokeDasharray: `${offset}px ${PERIMETER}px`, diff --git a/src/circle/test/__snapshots__/demo.spec.ts.snap b/src/circle/test/__snapshots__/demo.spec.ts.snap index 53cc1ccea..082650420 100644 --- a/src/circle/test/__snapshots__/demo.spec.ts.snap +++ b/src/circle/test/__snapshots__/demo.spec.ts.snap @@ -10,7 +10,7 @@ exports[`should render demo and match snapshot 1`] = ` > @@ -29,7 +29,7 @@ exports[`should render demo and match snapshot 1`] = ` > diff --git a/src/circle/test/__snapshots__/index.spec.ts.snap b/src/circle/test/__snapshots__/index.spec.ts.snap index 58a42660c..ecfb90743 100644 --- a/src/circle/test/__snapshots__/index.spec.ts.snap +++ b/src/circle/test/__snapshots__/index.spec.ts.snap @@ -9,7 +9,7 @@ exports[`should change stroke linecap when using stroke-linecap prop 1`] = ` > diff --git a/src/tag/index.tsx b/src/tag/index.tsx index ccc4e9867..1f07088f4 100644 --- a/src/tag/index.tsx +++ b/src/tag/index.tsx @@ -48,9 +48,13 @@ export default createComponent({ const renderTag = () => { const { type, mark, plain, round, size, closeable } = props; - const classes: Record = { mark, plain, round }; + const classes: Record = { + mark, + plain, + round, + }; if (size) { - classes[size] = !!size; + classes[size] = size; } const CloseIcon = closeable && (