mirror of https://github.com/ElemeFE/element
Badge: fix type class when is-dot (#21308)
parent
95445e209f
commit
492ab00ad7
|
@ -7,7 +7,7 @@
|
||||||
v-text="content"
|
v-text="content"
|
||||||
class="el-badge__content"
|
class="el-badge__content"
|
||||||
:class="[
|
:class="[
|
||||||
'el-badge__content--' + type,
|
type ? 'el-badge__content--' + type : null,
|
||||||
{
|
{
|
||||||
'is-fixed': $slots.default,
|
'is-fixed': $slots.default,
|
||||||
'is-dot': isDot
|
'is-dot': isDot
|
||||||
|
|
|
@ -32,6 +32,17 @@ describe('Badge', () => {
|
||||||
expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist;
|
expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('is dot with type', () => {
|
||||||
|
vm = createVue(`
|
||||||
|
<el-badge is-dot type="success">
|
||||||
|
<button>click</button>
|
||||||
|
</el-badge>
|
||||||
|
`);
|
||||||
|
|
||||||
|
expect(vm.$el.querySelector('.el-badge__content.is-dot')).to.exist;
|
||||||
|
expect(vm.$el.querySelector('.el-badge__content.el-badge__content--success.is-dot')).to.exist;
|
||||||
|
});
|
||||||
|
|
||||||
it('max', () => {
|
it('max', () => {
|
||||||
vm = createTest(Badge, { max: 100, value: 200 });
|
vm = createTest(Badge, { max: 100, value: 200 });
|
||||||
expect(vm.content).to.equal('100+');
|
expect(vm.content).to.equal('100+');
|
||||||
|
|
Loading…
Reference in New Issue