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

Button type links #44

Closed
dvelasquez opened this issue Feb 6, 2021 · 4 comments
Closed

Button type links #44

dvelasquez opened this issue Feb 6, 2021 · 4 comments

Comments

@dvelasquez
Copy link

Development Relevant Information:

  • BalmUI version: 8.18.0
  • Browser: Edge 88 (Chromium)
  • Operating System: Windows 10

Description:

Thanks for this amazing implementation of Material Design for Vue.

I've been looking at the source code and I haven't been able to find a way to use anchors <a href="">. All the button implementations wraps the component in <button> tags, which is useful, but for SEO reasons is better to use an anchor.

I've also tried to wrap the <ui-button> with <a></a> tags but this changes the looks in the label and this doesn't look pretty anymore.

For now I'm implementing a link component myself calling directly the Material Design classes, but this could be handled as a <ui-button type="link">

Steps To Reproduce:

  • Create a <ui-button>
    • wrap it in an <a></a>
@elf-mouse
Copy link
Member

elf-mouse commented Feb 7, 2021

Hi @dvelasquez ,

The early versions BalmUI has designed the link component, but it is not practical in vue projects (usually we will use router-link), so it was finally removed.

If you want to use the link rendered as button, recommend you to use like this:

<a class="mdc-button">Link</a>
<a class="mdc-button" v-ripple>Link with ripple</a>

@dvelasquez
Copy link
Author

Thanks @elf-mouse for the answer.

I ended up cloning the ui-button code and replacing it with a nuxt-link https://github.com/dvelasquez/nuxt-static-site/blob/2b5af684df314be4f7b16ccc46599e115b4052de/components/UiLink.vue

I needed to do this otherwise nuxtjs can crawl over the pages and generate them.

Thanks again for your great work :)

elf-mouse added a commit that referenced this issue Apr 9, 2021
@elf-mouse
Copy link
Member

Hi @dvelasquez ,

I have been added v-button directive for links since 8.31.0

<a v-button href="javascript:void(0)">Link</a>

This usage is better! See button docs for details.

@dvelasquez
Copy link
Author

dvelasquez commented Apr 11, 2021 via email

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

No branches or pull requests

2 participants