npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-router-spa-tabs

v1.1.29

Published

Tabbed Navigation for Vue Router in Single Page Applications

Downloads

10

Readme

Package Incomplete and Broken

Description

This Package is used to make your Application tabular, like chrome or sublime text. It achieves this by keeping a track of which routes do you want to open in tabs, opens those routes in tabs, and keeps alive those tabs so they are not rerendered everytime they open. Based on an amazing package by adamschwartz/chrome-tabs but molded for Vue Router

Note: Works best with socket implementation which updates the tabs on the fly for new data otherwise it would require to close and reopen the tab for rerendering it based on new data from server / database.

Installation

npm install vue-router-spa-tabs

Usage

1) Initialize the Package

app.js

import {tabs} from 'vue-router-spa-tabs'
tabs(store, router)

app.css

@import "node_modules/vue-router-spa-tabs/src/css/chromeTabs.css";

or copy paste css from file

1) Routes.js

Routes should include name and meta.tab with tab value is what will be displayed in the Tab Title

export const routes = [
{path: '/', component: App, name: 'home', meta: {tab: 'Dashboard'}}
];

2) Component Name = Router Link Name

router.js

{path: '/', name: 'home'}

component.vue

...
<script>
	export default {
		name: 'home'
	}
</script>
...

3) Make vue-router available global

window.router = rather than router =

window.router = new VueRouter({
routes
});

4) example.vue

<template>
	<div>
		<div class="chrome-tabs">
			<div class="chrome-tabs-content">
				<router-link tag="div" v-for="(tab, index) in tabs.tabsList" :to="{name: index}" 
				:id="index" exact-active-class="chrome-tab-current" class="chrome-tab chrome-tab-just-added">
				<div class="chrome-tab-background">
					<svg version="1.1" xmlns="http://www.w3.org/2000/svg"><defs><symbol id="topleft" viewBox="0 0 214 29" ><path d="M14.3 0.1L214 0.1 214 29 0 29C0 29 12.2 2.6 13.2 1.1 14.3-0.4 14.3 0.1 14.3 0.1Z"/></symbol><symbol id="topright" viewBox="0 0 214 29"><use xlink:href="#topleft"/></symbol><clipPath id="crop"><rect class="mask" width="100%" height="100%" x="0"/></clipPath></defs><svg width="50%" height="100%" transfrom="scale(-1, 1)"><use xlink:href="#topleft" width="214" height="29" class="chrome-tab-background"/><use xlink:href="#topleft" width="214" height="29" class="chrome-tab-shadow"/></svg><g transform="scale(-1, 1)"><svg width="50%" height="100%" x="-100%" y="0"><use xlink:href="#topright" width="214" height="29" class="chrome-tab-background"/><use xlink:href="#topright" width="214" height="29" class="chrome-tab-shadow"/></svg></g></svg>
				</div>
				<div class="chrome-tab-favicon" style="background-image: url('demo/images/facebook-favicon.ico')"></div>
				<div class="chrome-tab-title">{{tab}}</div>
				<div class="chrome-tab-close" @click.stop="tabDelete(index)"></div>
			</router-link>
		</div>
		<div class="chrome-tabs-bottom-bar"></div>
	</div>
	<keep-alive  :include="Object.keys(tabs.tabsList)">
		<!--<keep-alive  include="CustomersIndex,customers">-->
		<router-view></router-view>
	</keep-alive>
</div>
</template>

<script>
	import {mapState, mapActions} from 'vuex'
	import tabs from 'vue-router-spa-tabs'
	export default{
		computed:{
			...mapState([
				'tabs',
				]),
		},
		methods: {
			...mapActions([
				'tabDelete',
				'tabsInit',
				])
		}
	}
</script>