fixed #646
This commit is contained in:
parent
e4e8711d0f
commit
75c32564f0
2 changed files with 13 additions and 34 deletions
|
@ -14,37 +14,24 @@
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Badge count="3">
|
<Badge dot :count="count">
|
||||||
<a href="#" class="demo-badge"></a>
|
<a href="#" class="demo-badge"></a>
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge dot>
|
<Button @click="setCount">set count</Button>
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: {},
|
props: {},
|
||||||
data () {
|
data () {
|
||||||
return {};
|
return {
|
||||||
|
count: 50
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
methods: {
|
||||||
methods: {}
|
setCount () {
|
||||||
|
this.count = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
|
@ -61,17 +61,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
},
|
||||||
},
|
alone () {
|
||||||
data () {
|
return this.$slots.default === undefined;
|
||||||
return {
|
|
||||||
alone: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
const child_length = this.$refs.badge.children.length;
|
|
||||||
if (child_length === 1) {
|
|
||||||
this.alone = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue