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

UiTabs: Button in header cannot have click event #461

Open
wwoods opened this issue Aug 26, 2019 · 2 comments
Open

UiTabs: Button in header cannot have click event #461

wwoods opened this issue Aug 26, 2019 · 2 comments
Labels

Comments

@wwoods
Copy link

wwoods commented Aug 26, 2019

Using pug, I'm trying to set up a template like this:

    ui-tabs(:fullwidth="true")
      ui-tab(:selected="true")
        div(slot="header")
          span Overview
        ul
          li(v-for="item in files" @click="tabs.push(item)") {{item}}
      ui-tab(v-for="tab, idx in tabs")
        div(slot="header")
          span {{tab}}
          ui-icon-button(icon="close" size="small" @click.prevent="tabs.splice(idx, 1)")

The issue is that the @click for the ui-icon-button never gets triggered. I believe this is due to the way the render control is set up to indirectly render the tab header.

@wwoods
Copy link
Author

wwoods commented Aug 28, 2019

On further investigation, it looks like perhaps rather than the render hack you've implemented, you might consider using dynamic components: https://vuejs.org/v2/guide/components.html#Dynamic-Components

@JosephusPaye
Copy link
Owner

Hi @wwoods,

The current tab header implementation is not ideal and I've been meaning to rewrite it. I'll look into dynamic components to see if it can help here, thanks for the link 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants