2020-08-13 11:47:56 +08:00
|
|
|
|
<template>
|
|
|
|
|
<article>
|
|
|
|
|
<veui-badge
|
|
|
|
|
:value="count"
|
|
|
|
|
:max="100"
|
|
|
|
|
>
|
|
|
|
|
<veui-button
|
|
|
|
|
ui="primary"
|
|
|
|
|
@click="inc"
|
|
|
|
|
>
|
|
|
|
|
Add
|
|
|
|
|
</veui-button>
|
|
|
|
|
</veui-badge>
|
|
|
|
|
<veui-button
|
|
|
|
|
ui="s"
|
|
|
|
|
@click="reset"
|
|
|
|
|
>
|
|
|
|
|
Reset
|
|
|
|
|
</veui-button>
|
|
|
|
|
</article>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { Badge, Button } from 'veui'
|
|
|
|
|
|
|
|
|
|
const initial = 96
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
'veui-badge': Badge,
|
|
|
|
|
'veui-button': Button
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
count: initial
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
inc () {
|
|
|
|
|
this.count++
|
|
|
|
|
},
|
|
|
|
|
reset () {
|
|
|
|
|
this.count = initial
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2021-09-15 20:03:51 +08:00
|
|
|
|
<style lang="less" scoped>
|
2020-08-13 11:47:56 +08:00
|
|
|
|
.veui-badge {
|
|
|
|
|
margin-right: 2em;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<docs>
|
2021-10-20 01:11:27 +08:00
|
|
|
|
可以使用 [`max`](#props-max) 属性,指定可现实数字的最大值,超过则显示为“<var>max</var>+”。
|
2020-08-13 11:47:56 +08:00
|
|
|
|
</docs>
|
|
|
|
|
|
|
|
|
|
<docs locale="en-US">
|
2021-10-20 01:11:27 +08:00
|
|
|
|
Use the [`max`](#props-max) prop to specify the max value can be displayed. Displays “<var>max</var>+” when value is larger than `max`.
|
2020-08-13 11:47:56 +08:00
|
|
|
|
</docs>
|