Skip to content

docs: update FNavigationMenu documentation (refs SFKUI-6609)#111

Merged
NicklasWei merged 1 commit intomainfrom
menu-example
Dec 19, 2024
Merged

docs: update FNavigationMenu documentation (refs SFKUI-6609)#111
NicklasWei merged 1 commit intomainfrom
menu-example

Conversation

@NicklasWei
Copy link
Contributor

@NicklasWei NicklasWei commented Nov 11, 2024

EDIT: skrivit om dokumentationen lite mer så kallar till re-review.

Lägger till live exempel för navigeringsmenyn och försöker förbättra dokumentation lite grann.

@github-actions
Copy link

github-actions bot commented Nov 11, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-12-19 12:16 UTC

MCFK
MCFK previously approved these changes Nov 12, 2024
dvitamin
dvitamin previously approved these changes Nov 12, 2024

Om du anger `href` för objektet så kommer menyalternativet fungera som en vanlig länk med aktuellt `href` värde.

Utan `href` så skickas ett `selectedRoute` event med `route` för det valda alternativet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nu läser jag det som att selectedRoute eventet bara kommer om href saknas, dvs om jag sätter href så kommer inte eventet.

Är det korrekt? Oavsett borde det kanske förtydligas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eventet skickas oavsett om href används eller inte, både före och efter mina ändringar i den andra PR.

Jag tar och skriver om texten lite mer.

{ label: "label2", route: "ROUTE_2" },
{ label: "label3", route: "ROUTE_3" },
{ label: "label4", route: "ROUTE_4", href: "/", target: "" },
{ label: "label3", route: "ROUTE_3", href: "/", target: "_blank" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Vad innebär det att sätta både route och href? Det förvirrar mig.

@@ -15,15 +9,12 @@ import { FNavigationMenu } from "@fkui/vue";
import { routes } from "./router";
Copy link
Contributor

Choose a reason for hiding this comment

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

Hur ser den här ut? Vi visar aldrig för konsumenten var routes kommer från. För ghs-app-template fungerar det men inte för hundbidraget.

Sneglar jag på dokumentationen för vue-router samt vad npm create vue ger mig så fungerar det inte heller.

label: string;
/**
* Menu item route used upon for example item selection
* Unique route/path for the menu item. Used for item selection and reference.
Copy link
Contributor

Choose a reason for hiding this comment

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

Som läsare är jag nog lite förvirrad över denna. Exemplen har varit lite tvetydiga, jag vet inte vad jag ska skicka in här.

Om jag använder vue-router:

  • Är det path parametern från rutten? #/foobar? /foobar? foobar? Ska det matcha path i rutten?
  • Är det namned på rutten? Dvs ska det matcha name i rutten?

Om jag inte använder vue-router:

  • Då måste jag väl sätta href eller? Vad har jag denna till? Är det bara en unik identifierare?

Copy link
Contributor

@ext ext left a comment

Choose a reason for hiding this comment

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

Tycker nog det behöver göras en översyn över dokumentationen

@NicklasWei NicklasWei force-pushed the menu-example branch 4 times, most recently from ec3232d to 0c55785 Compare November 12, 2024 14:40
@NicklasWei NicklasWei dismissed stale reviews from dvitamin and MCFK via 0c55785 November 25, 2024 12:24
@NicklasWei NicklasWei force-pushed the menu-example branch 2 times, most recently from 8d2b28c to 8bd9e33 Compare December 15, 2024 21:05
@NicklasWei NicklasWei changed the title docs: add live example to FNavigationMenu (refs SFKUI-6609) docs: update FNavigationMenu documentation (refs SFKUI-6609) Dec 15, 2024
@NicklasWei NicklasWei requested review from MCFK, dvitamin and ext December 17, 2024 07:47
`route` används för att identifiera olika menyalternativ samt för att {@link FNavigationMenu#navigera_programmatiskt navigera programmatiskt} när ett alternativ väljs.

Du aktiverar vertikalt läge genom att använda `vertical` prop:
Om du inte vill navigera programmatiskt så ska du ange `href`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Tycker snabbt det blir svårbegripligt här. Vad innebär programmatisk navigering? Svaret är väl "du måste alltid sätta route och href förrutom om du kör med vue-router, då räcker det med route. Eller missuppfattar jag hur komponenten fungerar?

Varje gång jag försökt använt komponenten har jag bara velat ha en enkel meny, inget programmatiskt, v-model eller något men nu känns beskrivningen här svårtolkad, innan man ens vet att man måste sätta både route och href så pratas det om programmatiskt beteende.

Om du inte vill navigera programmatiskt så ska du ange `href`.
Då kommer den att fungera som en vanlig länk med aktuellt `href` värde.

## Navigera programmatiskt
Copy link
Contributor

Choose a reason for hiding this comment

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

Det är knappt att jag är med på vad "Navigera programmatiskt" är, när/varför behöver jag det?

Rubriken kanske kan nämna event?


```import
FNavigationMenuVertical.vue
### Navigera med Vue Router
Copy link
Contributor

Choose a reason for hiding this comment

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

Det här blev bra, tyvärr hade jag missuppfattat hur det fungerar så det är väl bra att det beskrivs här.

Jag trodde man skickade in samma routes array som till createRouter men så var visst inte fallet.

Copy link
Contributor

@Marie-Jakobsson Marie-Jakobsson left a comment

Choose a reason for hiding this comment

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

Lite svårläst och jag förstår inte hela sidan, men det här får nog en utvecklare bedöma vad som fungerar eller inte.

@NicklasWei NicklasWei force-pushed the menu-example branch 3 times, most recently from 7a80fc2 to bbe4ad2 Compare December 19, 2024 11:27
@NicklasWei NicklasWei requested a review from ext December 19, 2024 11:37
@NicklasWei NicklasWei merged commit 43c06ad into main Dec 19, 2024
@NicklasWei NicklasWei deleted the menu-example branch December 19, 2024 12:15
@github-actions
Copy link

🎉 This PR is included in version 5.45.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

5 participants