Skip to content

How to call component methods (Ionic 4 + Vue.js 2) #827

Closed

Description

@ionitron-bot

Original issue by @kms695 on 2019-07-17T06:54:31Z

For example, if I use the ion-tabs and want to change the current tab manually, there is a select method provided for this component which returns a promise. But I don't understand how to use given methods of components (in Vue.js).

Does anyone know how this works? The corresponding doc is here: https://ionicframework.com/docs/api/tabs

I don't understand how to use the given methods of components at all. There are several examples, mostly for Angular, which are outdated. I seek a solution for Vue.js only.

Activity

  1. added
    package: vue
    on Oct 26, 2019
  2. renqianwen commented on Nov 14, 2019

    @renqianwen

    I also want to know how...

  3. kevinXmichael commented on Nov 14, 2019

    @kevinXmichael
  4. EllieSadler commented on Jan 13, 2020

    @EllieSadler

    I do not have an answer to this, but am also seeking an answer to this relatively simple question. If anyone find an answer, please post here. I'll do the same.

  5. dotNetkow commented on Feb 13, 2020

    @dotNetkow
    Contributor

    Hi everyone, Vue support is currently in beta. Hence why our docs/guides aren't as robust as React or Angular. We've got a Vue channel in our Ionic Community Slack that might provide more immediate assistance.

  6. cabassi commented on Mar 11, 2020

    @cabassi

    Has someone found a solution for this?

  7. kevinXmichael commented on Mar 11, 2020

    @kevinXmichael

    Hi, I still did not found any solution for this feature, neither for Vue nor React, Angular, VanillaJS. A better framework for developing an overall app for the web and mobile is quasar. The doc is awesome, just try it, you will be happy with it.

  8. cabassi commented on Mar 11, 2020

    @cabassi

    Hi, I found several solutions for ng, the problem is with IonicVue that's in beta.
    @dotNetkow your link for Ionic Community Slack's not working at the time I'm writing :(

  9. kevinXmichael commented on Mar 11, 2020

    @kevinXmichael

    The slack "support" is generally not really caring. In "beta"... like a year or so.

  10. cabassi commented on Mar 11, 2020

    @cabassi

    Btw the workaround I'm using is Vue.$refs

    e.g. If you want to call the close() method on

    in the template
    <ion-item-sliding ref="slidingItem">

    And when I want to call something on the ion-item-sliding element I do
    this.$refs.slidingItem.close();

  11. kevinXmichael commented on Mar 11, 2020

    @kevinXmichael

    Yes this works but I wonder why calling the other functions which return a Promise does not work?

  12. nesthor12 commented on Apr 2, 2020

    @nesthor12

    any luck with this issue?

  13. kevinXmichael commented on Apr 3, 2020

    @kevinXmichael

    Nope

  14. nesthor12 commented on Apr 3, 2020

    @nesthor12
  15. kevinXmichael commented on Apr 3, 2020

    @kevinXmichael
  16. nesthor12 commented on Apr 7, 2020

    @nesthor12
  17. kevinXmichael commented on Apr 7, 2020

    @kevinXmichael
  18. cabassi commented on Apr 7, 2020

    @cabassi
  19. kevinXmichael commented on Apr 7, 2020

    @kevinXmichael

    @cabassi the ionic's platform customization would be great, I currently work with the Capacitor plugins and if something is not working / available I use Cordova plugins.

    How to you handle / listen to events on the component?

  20. mrpbaum commented on Feb 9, 2022

    @mrpbaum

    I'm not using any framework. How do I get a reference to a component to call its methods?

  21. added
    triage
    and removed
    package: vue
    on Sep 20, 2022
  22. added
    content
    on Oct 13, 2025
  23. brandyscarney commented on Nov 18, 2025

    @brandyscarney
    Member

    Thanks for the issue! This was resolved by #4281 and is live at Tabs: Programmatically Selecting Tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    content

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions