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

feat(nuxt): support trailingSlashBehavior in defineNuxtLink #19458

Merged

Conversation

alex-key
Copy link
Contributor

@alex-key alex-key commented Mar 5, 2023

πŸ”— Linked issue

resolves #18806

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add a new option trailingSlashBehavior to options in defineNuxtLink. Using it user can define his own component like <MyNuxtLink /> and either force always trailing slash or force no-slash for all internal urls.
Resolves #18806

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Mar 5, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@alex-key
Copy link
Contributor Author

alex-key commented Mar 5, 2023

@danielroe Daniel, could you confirm those failures are related to PR changes? It seems unrelated to me.

@manniL
Copy link
Member

manniL commented Mar 5, 2023

AssertionError: expected 93412 to be less than 93000

@alex-key you might have to update the test as the default size of the nuxt application increased.

Copy link
Member

@manniL manniL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM πŸ‘

packages/nuxt/src/app/components/nuxt-link.ts Outdated Show resolved Hide resolved
@alex-key
Copy link
Contributor Author

alex-key commented Mar 5, 2023

Pushed suggested fixes so far

@danielroe
Copy link
Member

@alex-key have you pushed all of your changes so far?

@alex-key
Copy link
Contributor Author

alex-key commented Mar 6, 2023

Yes, done

@danielroe danielroe requested a review from manniL March 6, 2023 16:36
danielroe and others added 3 commits March 6, 2023 14:45
@danielroe danielroe changed the title feat(nuxt): add trailingSlashBehavior to defineNuxtLink options feat(nuxt): add trailingSlashBehavior to defineNuxtLink options Mar 6, 2023
@danielroe danielroe changed the title feat(nuxt): add trailingSlashBehavior to defineNuxtLink options feat(nuxt): support trailingSlashBehavior in defineNuxtLink Mar 7, 2023
@danielroe danielroe merged commit 3a73f42 into nuxt:main Mar 7, 2023
@danielroe danielroe mentioned this pull request Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support trailingSlash behavior for createNuxtLink
4 participants