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-preload-page

v1.0.3

Published

预加载vue的页面js文件

Downloads

3

Readme

vue-preload-page

喜欢的希望能到github给小弟点个赞,github: https://github.com/liberties

预加载vue的页面js文件

先在入口处引入插件

import vuePreload from 'vue-preload-page';
import Vue from 'vue';
//router为vue-router的实例
vuePreload(router,Vue);

然后在组件处配置一下,比如你想在a页面预加载其他页面的js,就配置一下它们的路由到数组中就行。

可以发现浏览该页面的时候,会自动延迟下载配置的其他页面

ps:这里和mini-ls搭配更佳,目前实现了一整套方案,可以缓存静态js、缓存api接口到本地,然后加上预加载js,配合上骨架图,感觉优化效果感觉还不错。可惜的是目前公司方案没办法上骨架图了。希望能够后期重构一下。

本来打算预加载api数据的,但是考虑到某些接口需要变量作为参数,有很多不确定性,所以先不贸然处理,大佬有其他更好的方案希望能分享一下给我。