2017-03-02 12:05:57 +08:00
|
|
|
<style scoped>
|
|
|
|
.demo-badge{
|
|
|
|
width: 42px;
|
|
|
|
height: 42px;
|
|
|
|
background: #eee;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style>
|
|
|
|
.demo-badge-alone{
|
|
|
|
background: #5cb85c !important;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<template>
|
|
|
|
<div>
|
2018-06-21 11:34:25 +08:00
|
|
|
<Badge :count="count">
|
2017-03-02 12:05:57 +08:00
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
2018-05-19 23:05:17 +08:00
|
|
|
<Badge :count="0" showZero>
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
2017-06-02 11:43:02 +08:00
|
|
|
<Button @click="setCount">set count</Button>
|
2018-06-21 11:34:25 +08:00
|
|
|
<br><br>
|
|
|
|
<Badge text="hot">
|
|
|
|
<Button type="ghost">Hello</Button>
|
|
|
|
</Badge>
|
2018-06-21 11:47:10 +08:00
|
|
|
<br><br>
|
|
|
|
<div>
|
|
|
|
<Badge status="success" />
|
|
|
|
<Badge status="error" />
|
|
|
|
<Badge status="default" />
|
|
|
|
<Badge status="processing" />
|
|
|
|
<Badge status="warning" />
|
|
|
|
<br />
|
|
|
|
<Badge status="success" text="Success" />
|
|
|
|
<br />
|
|
|
|
<Badge status="error" text="Error" />
|
|
|
|
<br />
|
|
|
|
<Badge status="default" text="Default" />
|
|
|
|
<br />
|
|
|
|
<Badge status="processing" text="Processing" />
|
|
|
|
<br />
|
|
|
|
<Badge status="warning" text="Warning" />
|
|
|
|
</div>
|
2018-06-21 12:39:37 +08:00
|
|
|
<div style="margin: 50px">
|
|
|
|
<Badge dot>
|
|
|
|
<a href="//iviewui.com">我是一个链接</a>
|
|
|
|
</Badge>
|
|
|
|
<br><br>
|
|
|
|
<Badge :count="10" :offset="[-5, -5]">
|
|
|
|
<a href="//iviewui.com">我是一个链接</a>
|
|
|
|
</Badge>
|
|
|
|
</div>
|
2018-06-21 15:04:49 +08:00
|
|
|
<div>
|
|
|
|
<Badge :count="count" type="primary">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count" type="success">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count" type="normal">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count" type="info">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count" type="error">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count" type="warning">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
<Badge :count="count">
|
|
|
|
<a href="#" class="demo-badge"></a>
|
|
|
|
</Badge>
|
|
|
|
</div>
|
2017-03-02 12:05:57 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {},
|
|
|
|
data () {
|
2017-06-02 11:43:02 +08:00
|
|
|
return {
|
2018-06-21 11:34:25 +08:00
|
|
|
count: 5
|
2017-06-02 11:43:02 +08:00
|
|
|
};
|
2017-03-02 12:05:57 +08:00
|
|
|
},
|
2017-06-02 11:43:02 +08:00
|
|
|
methods: {
|
|
|
|
setCount () {
|
|
|
|
this.count = 10;
|
|
|
|
}
|
|
|
|
}
|
2017-03-02 12:05:57 +08:00
|
|
|
};
|
|
|
|
</script>
|