GithubHelp home page GithubHelp logo

richardeschloss / nuxt-router-ui Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 1.08 MB

A Router-UI for Nuxt and Vue.

Home Page: https://nuxt-router-ui.netlify.app

License: MIT License

JavaScript 59.68% SCSS 36.77% Vue 3.43% CSS 0.12%
router vue nuxt d3

nuxt-router-ui's Introduction

npm npm NPM

๐Ÿ“– Release Notes

nuxt-router-ui

A router UI for Nuxt and VueJS. Stash it in the footer and just use it when you need it! Hide it when you don't!

Demo

Action Result
Ctrl + Shift + Space Opens the Router UI
Click (on node) Opens the route's children, if any
Ctrl + Click (on node) Navigates to that route's path. If it's a parameterized route, you'll be prompted for parameters before navigation (only if parameters are required)*
Ctrl + Shift + Click (on node) Similar as Ctrl + Click, but force opens the prompt for the parameterized route, whether the parameters are required or not

(*Note: after parameters are input and submitted, they are cached to localStorage so that you don't have to keep re-entering the parameters.)

The router UI will always start with the current route's node expanded to show it's children.

Install it

  • Nuxt2.x
$ npm i -D nuxt-router-ui
  • Nuxt3.x
$ npm i -D nuxt-router-ui@next

Nuxt Config (one-line)

nuxt.config.js

export default {
  ...,
  buildModules: ['nuxt-router-ui'],
  ...
}

Vue only config

your-globals.js

import Vue from 'vue'
import D3RouterUI from 'nuxt-router-ui/lib/VueD3/D3RouterUI.js'

Vue.component('D3RouterUI', D3RouterUI) // provides the component and scoped styles

Embed it

The component to embed is <D3RouterUI />. Find a part of your app that is pretty much fixed, like the footer:

layouts/default.vue

<template>
  <div>
    <Nuxt />
    <D3RouterUI />
  </div>
</template>

nuxt-router-ui's People

Contributors

richardeschloss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nuxt-router-ui's Issues

Replace bootstrap modal with vanilla css modal

Replace bootstrap modal with vanilla css modal.

Since this is the only component used by the module, the package can be made much more lightweight if the modal is independent of all of bootstrap. This would further provide the benefit of not conflicting with other user styles they have. (Otherwise, they'd have to use "!important" on all their conflicts).

If the look-and-feel of the modal is still desired, it may be possible to just port over the specific b-modal styles to this, and simply re-use them.

Potentially helpful resource:
https://dev.to/dailydevtips1/vanilla-javascript-modal-pop-up-2okit

Caveat:

  • Swapping out the b-modal component also means we'll lose the $bvModal().show and $bvModal.hide() methods...but that part is pretty straightforward to implement.

Dependencies --> DevDependencies

  • nuxt should go to devDeps. (People either already have nuxt, or not...if they install this on a vue-only project, they should still be able to use it)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.