Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Emit event (click) on CButton #192

Unanswered
aviatmcel asked this question in Q&A
Mar 8, 2022 · 2 comments · 9 replies
Discussion options

We are testing out free version of CoreUI 4 for Vue, and are having trouble registering events (for example click) on simple components like CButton. Is there a recommended way to this? Is this maybe only available on PRO version?

Thanks!

You must be logged in to vote

Replies: 2 comments · 9 replies

Comment options

Can you show some code for a CButton that's not working for you? If there's one thing a button should be able to do, that's click! 😉

You must be logged in to vote
1 reply
@aviatmcel
Comment options

for example, we tried adding @click event listener on CButton, but click event didn't register:

<c-button
    @click="login"
    :disabled="isLoading"
    color="primary"
    type="submit"
    class="px-4"
>
    Login
</c-button>

If we add a wrapper div around it, and place the @click event listener there, it registers the click.

Comment options

@aviatmcel I will try to release the fix tomorrow.

BTW. I replied to your support ticket 2 days ago, did you get my email?

You must be logged in to vote
8 replies
@mrholek
Comment options

Can you try to remove this line :disabled="isLoading" and check.

If disabled is to true then the button doesn't emit the event.

@aviatmcel
Comment options

hmm no, removing :disabled="isLoading" also didn't help.

I can make it work by adding .native to @click, like this:
<c-button @click.native="login">Login CB</c-button>

Maybe I forgot to import some part of CoreUI lib? I have these imports in main.js:

import '@coreui/coreui/dist/css/coreui.min.css';
import CoreUI from '@coreui/vue';
app.use(CoreUI);

BTW, still not getting any email response from support :)

@mrholek
Comment options

Please change import CoreUI from '@coreui/vue'; => import CoreuiVue from '@coreui/vue', and app.use(CoreUI); => app.use(CoreuiVue);

@aviatmcel
Comment options

hmm, changed this, but its still the same, only works with @click.native

@mrholek
Comment options

@aviatmcel please update to version v4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.