diff --git a/examples/docs/en-US/dropdown.md b/examples/docs/en-US/dropdown.md index eb426c433..ad30c5a98 100644 --- a/examples/docs/en-US/dropdown.md +++ b/examples/docs/en-US/dropdown.md @@ -3,6 +3,9 @@ methods: { handleClick() { alert('button click'); + }, + handleCommand(command) { + this.$message('click on item ' + command); } } } @@ -126,6 +129,36 @@ Use `hide-on-click` to define if menu closes on clicking. ``` ::: +### Command event + +Clicking each dropdown item fires an event whose parameter is assigned by each item. + +:::demo +```html + + + Dropdown List + + + Action 1 + Action 2 + Action 3 + Action 4 + Action 5 + + + +``` +::: + ### Dropdown Attributes | Attribute | Description | Type | Accepted Values | Default | diff --git a/examples/docs/en-US/tabs.md b/examples/docs/en-US/tabs.md index 36009b1f7..557390758 100644 --- a/examples/docs/en-US/tabs.md +++ b/examples/docs/en-US/tabs.md @@ -11,6 +11,9 @@ }, handleClick(tab, event) { console.log(tab, event); + }, + renderTab(h, tab) { + return {tab.label}; } } } @@ -125,6 +128,30 @@ Border card tabs. ::: +### Custom Tab + +You can use `label-content` property to customize the tab + +:::demo `label-content` is a render function,which return the vnode of the tab. +```html + + Route + Config + Role + Task + + +``` +::: + ### Tabs Attributes | Attribute | Description | Type | Accepted Values | Default | |---------- |-------- |---------- |------------- |-------- | diff --git a/examples/docs/zh-CN/dropdown.md b/examples/docs/zh-CN/dropdown.md index ad8863fa2..26f6b8c45 100644 --- a/examples/docs/zh-CN/dropdown.md +++ b/examples/docs/zh-CN/dropdown.md @@ -43,6 +43,9 @@ methods: { handleClick() { alert('button click'); + }, + handleCommand(command) { + this.$message('click on item ' + command); } } } @@ -168,6 +171,35 @@ ``` ::: +### 指令事件 + +点击菜单项后会触发事件,用户可以通过相应的菜单项 key 进行不同的操作 + +:::demo +```html + + + 下拉菜单 + + + 黄金糕 + 狮子头 + 螺蛳粉 + 双皮奶 + 蚵仔煎 + + + +``` +::: ### Dropdown Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | diff --git a/examples/docs/zh-CN/tabs.md b/examples/docs/zh-CN/tabs.md index e77a31ed7..d885a4e63 100644 --- a/examples/docs/zh-CN/tabs.md +++ b/examples/docs/zh-CN/tabs.md @@ -11,6 +11,9 @@ }, handleClick(tab, event) { console.log(tab, event); + }, + renderTab(h, tab) { + return {tab.label}; } } } @@ -120,6 +123,30 @@ ``` ::: +### 自定义标签页 + +可以通过 `label-content` 属性来实现自定义标签页的内容 + +:::demo `label-content` 是一个 render function,在这个方法里返回的 vnode 会被渲染到标签页中。 +```html + + 我的行程 + 消息中心 + 角色管理 + 定时任务补偿 + + +``` +::: + ### Tabs Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------- |-------- |---------- |------------- |-------- |