question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idiomatic way to handle navigation?

See original GitHub issue

Hi Evan and crew –

Truly remarkable product. I’ve worked with computed for 30 years and this is one of the best things I’ve encountered.

I’ve run into an issue recently where a computed navigation isn’t updating. Trying to understand the recommended course of action/idiomatic way of handling.

The Setup

  1. Router encapsulates App
  2. App contains NavBar and RouterView
  3. RouterView is populated with Pages
  4. The NavBar varies somewhat page to page
<app>
  <nav-bar></nav-bar>
  <router-view></router-view>
</app>

I’m currently keeping the NavBar separate from the page as a) I would like it to remain a fixture even as routes are changed, and b) it’s concerns are somewhat separate from the page.

The Nav Items

Each Page contains NavItems it would like to append. When the Page is loaded, it emits an event, which allows the App to bind to certain of the pages properties (including navItems). The App’s navItems are bound to the NavBar via a prop.

The Problem

For some Pages, navItems is a computed property (dynamic), which precedents. When the precedents are updated, the computed navItems is not recalculating.

Ideally I’d like to keep the navItems attached to the Page, and the NavBar attached to the App (as a reusable component). Nonetheless, I’m open to restructuring if there are more appropriate ways of handling.

Thanks!

Brandon

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
yyx990803commented, May 23, 2016

Hi Brandon, thanks for the interest, however GitHub issues are used for bug reports and feature requests. Please move discussions to the forum instead.

0reactions
brandoncarlcommented, May 23, 2016

Apologies - wasn’t sure if this was intended behavior or not, but I’ll reserve this for known bugs only going forward.

On May 23, 2016, 15:40 -0400, Denis Karabazanotifications@github.com, wrote:

If you can reproduce the issue, then feel free to file it.

A hacky solution to the original issue:https://jsfiddle.net/simplesmiler/xto1h4k4/4/ An idiomatic solution would be to define a set of possible nav items strategies, and to use vuex (or other state container) to store current strategy and necessary data for it.

Was about to close the issue, but Evan was faster.

— You are receiving this because you authored the thread. Reply to this email directly orview it on GitHub(https://github.com/vuejs/vue/issues/2939#issuecomment-221073325)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Synonyms for Navigate - 24 Idioms - Classic Thesaurus
Synonyms for 'Navigate'. Best idiom synonyms for 'navigate' are 'go on shipboard', 'find the way' and 'go to sea'.
Read more >
Navigation - Idioms by The Free Dictionary
computers A form of navigation in which the destination of a link or button is not apparent until the user mouses over it...
Read more >
A list of phrases related to the word "navigate"
A list of phrases related to the word "navigate"... · Automatic pilot · Bum steer · Chart a course · Command and control...
Read more >
Idiomatic way of handling optional values in Swift
A better way to handle optional values is "optional binding": if let path = NSBundle.mainBundle().pathForResource("NavigationMenu", ofType: ...
Read more >
Navigate Definition & Meaning - Merriam-Webster
The meaning of NAVIGATE is to travel by water : sail. How to use navigate in a sentence. ... to steer or manage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found