pagerjs

PagerJS how to build a navbar?

好久不见. 提交于 2020-01-21 12:12:36
问题 My goal is to write some reusable code to render basic navbars, since it would be a very repetitive task. The following features are my first goal: Each page should be rendered in a foreach binding Each page should grab the active state reading current route Each page should be loaded either async or inline Here's my first attempt. I want markup to be something like this <ul data-bind='foreach: pages'> <li> <!-- [1] Here a toggler is needed for active/no-active status, i.e. a class binding. -

PagerJS how to build a navbar?

不想你离开。 提交于 2020-01-21 12:12:05
问题 My goal is to write some reusable code to render basic navbars, since it would be a very repetitive task. The following features are my first goal: Each page should be rendered in a foreach binding Each page should grab the active state reading current route Each page should be loaded either async or inline Here's my first attempt. I want markup to be something like this <ul data-bind='foreach: pages'> <li> <!-- [1] Here a toggler is needed for active/no-active status, i.e. a class binding. -