Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabs组件无法触发自定义事件监听器 #189

Closed
1 task
iczer opened this issue Sep 13, 2018 · 5 comments
Closed
1 task

tabs组件无法触发自定义事件监听器 #189

iczer opened this issue Sep 13, 2018 · 5 comments
Labels

Comments

@iczer
Copy link

iczer commented Sep 13, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.1.0

Environment

win10 chrome 版本 67.0.3396.99

Reproduction link

Edit on CodeSandbox

Steps to reproduce

<template>
  <div style="margin: 100px">
    <a-button v-on="myListeners">点击我触发自定义监听器</a-button>
    <br/><br/>
    <div>点击下面的tab无法触发自定义监听器</div>
    <a-tabs v-on="myListeners" type="card">
      <a-tab-pane v-on="myListeners" tab="tab1" key="1">content1</a-tab-pane>
      <a-tab-pane v-on="myListeners" tab="tab1" key="2">content2</a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
export default {
  name: 'App',
  computed: {
    myListeners () {
      let _this = this
      return {
        ...this.$listeners,
        click (e) {
          _this.$message.info('click')
        },
        mouseup () {
          _this.$message.info('mouseup')
        }
      }
    }
  }
}
</script>

What is expected?

tabs组件可以支持自定义事件监听器,以便于用户扩展(比如标签页右键菜单)

What is actually happening?

tabs组件无法触发自定义事件监听器

tangjinzhou pushed a commit that referenced this issue Sep 13, 2018
@tangjinzhou
Copy link
Member

please update to 1.1.1

@iczer
Copy link
Author

iczer commented Sep 14, 2018

感谢大大。
不过我貌似漏提了问题,也是 Tabs组件的自定义监听器。1.1.1版本 Tabs 加上了 $listeners, 但子组件Tabs.TabPane 目前好像还是不支持的,能不能也加上。

@tangjinzhou
Copy link
Member

后面可以考虑添加,也欢迎pr,
现在你可以在 tabpane的子元素上直接添加事件

@iczer
Copy link
Author

iczer commented Sep 14, 2018

好的,感谢

@github-actions
Copy link

github-actions bot commented Apr 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants