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-title

v0.0.3

Published

auto change document title with vue-router

Downloads

3

Readme

vue-router-title 说明

该插件旨在帮助快捷的改变文档标题

使用方法


router = new VueRouter({
    routes:[
        {...meta:{ title:"title" }...},
        {...meta:{ title:"title" }...},
        {...meta:{ title:"title" }...},
    ]
);

VueRouterTitle(options)

//or

Vue.use(VueRouterTitle,options) //只是为了看着好看一些

参数说明

route.meta.title

类型: String || Funcition(to, {router, store})

说明:给需要配置title的路由的meta标签赋值。当为字符串时会直接将该字符串作为初始的目标标题。当目标为函数时,会传入前往的路由对象、以及包含传入配置的 routerstore 两个对象的对象,并利用返回的字符串作为初始的目标标题。


options.defaultTitle

类型: String

说明:当所在嵌套路由链上没有meta.title时,页面标题默认展示为defaultTile

options.router

类型: VueRouter

说明:需要配置的 router 对象

options.Store

类型: Vuex.Store

说明:需要配置的 Vuex.Store 对象

options.beforeEach()

类型: Funcition(title, to, {router, store})

说明:修改标题前执行的函数。会传入当前标题、前往的路由对象、以及包含传入配置的 routerstore 两个对象的对象。需要返回一个字符串来作为新的标题。

options.afterEach()

类型: Funcition(title, to, {router, store})

说明:修改标题后执行的函数。传入的参数同 beforeEach()