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

Implement BaseLink component #84

Closed
patrickcate opened this issue Oct 30, 2021 · 0 comments
Closed

Implement BaseLink component #84

patrickcate opened this issue Oct 30, 2021 · 0 comments
Assignees
Labels
feature New feature or request

Comments

@patrickcate
Copy link
Owner

BaseLink

A base link component that renders as a <nuxt-link>, <router-link>, or <a> element.

status: draft

Props

Name Type Default Required Options
href String '' false n/a
to [String, Object] '' false n/a
name String '' false n/a
params Object {} false n/a
query Object {} false n/a
text String '' false n/a

Slots

  • default

CSS Classes

  • None

External Libraries

  • None

Sub-Components

  • None

Dependencies

  • None

Notes

Tests

  1. The component renders as a <nuxt-link> component if Nuxt is detected.
  2. The component renders as a <router-link> component if the to, name, or params props are used.
  3. The component renders as a <a> if the href prop is used.
  4. The slot content correctly renders.
  5. When the text prop is used, the text is added as the link text.
  6. When the default slot is used, the content is added as the link text.
  7. When the text prop and default slot are both used, the default slot will override the text prop.
  8. The router-link current route class needs to be set to usa-current.
@patrickcate patrickcate self-assigned this Nov 11, 2021
@patrickcate patrickcate added the feature New feature or request label Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant