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

Dynamic labels for Menu components #449

Closed
Rakasch opened this issue Aug 20, 2020 · 4 comments
Closed

Dynamic labels for Menu components #449

Rakasch opened this issue Aug 20, 2020 · 4 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add vue2-portable
Milestone

Comments

@Rakasch
Copy link
Contributor

Rakasch commented Aug 20, 2020

Would be nice, if the 'label' and 'icon' would also support a function or component variable - instead of a string.
My current solution for a dynamic text is to change the text before opening the menu.
image

@cagataycivici cagataycivici changed the title [enhancement] Menu items with dynamic labeltext Menu items with dynamic labeltext Aug 27, 2020
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Aug 27, 2020
@cagataycivici
Copy link
Member

Thanks, will keep this to wait for more user requests to proceed.

@mllull
Copy link

mllull commented Jan 20, 2021

Hi @Rakasch,

Finally I solved the issue using this code:

const userItems = ref([
      {
        label: "",
        disabled: true
      },
      {
        label: "Close session",
        icon: "fas fa-sign-out-alt",
        command: () => keycloak.logoutFn()
      }
    ]);


onMounted(() => {
    ...
    userItems.value[0].label = me.value.username;
    ...
});

I'm using Vue3, maybe you can adapt this code to Vue2.

@cagataycivici cagataycivici removed the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label May 10, 2021
@cagataycivici
Copy link
Member

Thanks for sharing the solution.

@Rakasch
Copy link
Contributor Author

Rakasch commented May 10, 2021

well, it's the same "solution" I used, isn't it?

@cagataycivici cagataycivici reopened this Nov 17, 2021
@cagataycivici cagataycivici self-assigned this Nov 17, 2021
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Nov 17, 2021
@cagataycivici cagataycivici changed the title Menu items with dynamic labeltext Dynamic labels for Menu components Nov 17, 2021
@cagataycivici cagataycivici added this to the 3.9.0 milestone Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add vue2-portable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants