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

@hudk/vue-uri

v0.1.4

Published

easy query uri import for vue & vue-router

Downloads

12

Readme

vue-uri

easy query uri import for vue & vue-router

usage

  1. 项目中需使用vue2.x及对应的vue-router

    npm install @hudk/vue-uri
  2. 引入

    • 全局引入
      import { query } from '@hudk/vue-uri';
      Vue.mixin(query);
    • 组件引入
      import { query } from '@hudk/vue-uri';
          
      Vue.extends({
        mixins: [query]
      });
  3. 使用

    • 在组件的data中定义{Object}queryData,用于存放需要放到uri中的数据;在methods中定义query方法,用于发起真正的请求

    • 在需要发起请求的地方,调用handleQuery方法,方法会将queryData放到uri上并自动存储一次

    • 对于翻页和回车查询这两类在query中常用的操作,vue-uri 提供了两个方法:对于回车查询,对需要触发回车自动查询的属性绑定 DOMElement.onkeyDown = this.keyDown ;对换页查询,换页后直接触发handleCurrentChange(page, pageSize),page与pageSize会默认被加到query中,可通过 this.m_pagethis.m_pageSize 两个属性获取这两个值

跳页逻辑

注意

  1. 空值不会被挂载到router中,也不会用作跳页逻辑中的逻辑比较,应当给一个其他值(比如' ')