mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-10-08 18:00:00 +08:00
[new feature] Tag: add click event (#2693)
This commit is contained in:
parent
9c5e5b8158
commit
305dc19ceb
@ -81,3 +81,9 @@ Vue.use(Tag);
|
|||||||
| name | Description |
|
| name | Description |
|
||||||
|------|------|
|
|------|------|
|
||||||
| - | Default slot |
|
| - | Default slot |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| Event | Description | Arguments |
|
||||||
|
|------|------|------|
|
||||||
|
| click | Triggered when clicked | - |
|
||||||
|
16
packages/tag/test/index.spec.js
Normal file
16
packages/tag/test/index.spec.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import Tag from '..';
|
||||||
|
import { mount } from '../../../test/utils';
|
||||||
|
|
||||||
|
test('click event', () => {
|
||||||
|
const click = jest.fn();
|
||||||
|
const wrapper = mount(Tag, {
|
||||||
|
context: {
|
||||||
|
on: {
|
||||||
|
click
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
wrapper.trigger('click');
|
||||||
|
expect(click.mock.calls.length).toEqual(1);
|
||||||
|
});
|
@ -88,3 +88,9 @@ Vue.use(Tag);
|
|||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
|------|------|
|
|------|------|
|
||||||
| - | 自定义 Tag 显示内容 |
|
| - | 自定义 Tag 显示内容 |
|
||||||
|
|
||||||
|
### Event
|
||||||
|
|
||||||
|
| 事件名 | 说明 | 参数 |
|
||||||
|
|------|------|------|
|
||||||
|
| click | 点击时触发 | - |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user