Skip to content

Commit

Permalink
docs: ✏️ 移除文档中CountTo不支持的type
Browse files Browse the repository at this point in the history
  • Loading branch information
Moonofweisheng committed Sep 12, 2024
1 parent 60c92f2 commit cae2e56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/countTo/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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="手动控制">
Expand Down
5 changes: 3 additions & 2 deletions src/uni_modules/wot-design-uni/components/wd-text/wd-text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand Down

0 comments on commit cae2e56

Please sign in to comment.