Support Badge

Support Badge
This commit is contained in:
梁灏 2017-03-02 12:05:57 +08:00
parent 5d122b374c
commit 15368be172
7 changed files with 66 additions and 9 deletions

View file

@ -23,6 +23,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
<li><router-link to="/timeline">Timeline</router-link></li>
<li><router-link to="/switch">Switch</router-link></li>
<li><router-link to="/alert">Alert</router-link></li>
<li><router-link to="/badge">Badge</router-link></li>
</ul>
</nav>
<router-view></router-view>

View file

@ -56,6 +56,10 @@ const router = new VueRouter({
{
path: '/alert',
component: require('./routers/alert.vue')
},
{
path: '/badge',
component: require('./routers/badge.vue')
}
]
});

50
test/routers/badge.vue Normal file
View file

@ -0,0 +1,50 @@
<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>
<Badge count="3">
<a href="#" class="demo-badge"></a>
</Badge>
<Badge dot>
<a href="#" class="demo-badge"></a>
</Badge>
<Badge dot>
<Icon type="ios-bell-outline" size="26"></Icon>
</Badge>
<Badge dot>
<a href="#">可以是一个链接</a>
</Badge>
<Badge count="100">
<a href="#" class="demo-badge"></a>
</Badge>
<Badge count="1000" overflow-count="999">
<a href="#" class="demo-badge"></a>
</Badge>
<br>
<Badge count="10"></Badge>
<br><br>
<Badge count="20" class-name="demo-badge-alone"></Badge>
</div>
</template>
<script>
export default {
props: {},
data () {
return {};
},
computed: {},
methods: {}
};
</script>