docs: ✏️ 移除文档中CountTo不支持的type

This commit is contained in:
Moonofweisheng 2024-09-12 18:51:45 +08:00
parent 60c92f2f38
commit cae2e56aba
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,7 @@
<wd-count-to type="error" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to>
<wd-count-to type="success" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to>
<wd-count-to type="warning" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to>
<wd-count-to type="info" prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to>
<wd-count-to prefix="¥" :startVal="0" :endVal="888888" suffix="%"></wd-count-to>
</demo-block>
<demo-block title="手动控制">

View File

@ -43,8 +43,9 @@ watch(
}),
({ type }) => {
// type
if (type && !['primary', 'error', 'warning', 'success', 'default'].includes(type)) {
console.error(`type must be one of ${type.toString()}`)
const types = ['primary', 'error', 'warning', 'success', 'default']
if (type && !types.includes(type)) {
console.error(`type must be one of ${types.toString()}`)
}
computeTextClass()
},