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

v0.2.0

Published

Vue components and directives to progressively enhance your site with PJAX

Downloads

6

Readme

vue-pjax

Latest Version on NPM Software License

THIS IS AN EXPERIMENT THAT MIGHT NEVER GET A STABLE RELEASE

This package provides a Vue component and directive to progressively enhance your site with pjax.

<!--
    Clicking one of the links will replace `pjax-container`'s contents since
    it's name is linked to the `v-pjax` directive.
-->

<ul>
    <li><a href="/foo" v-pjax:content>Foo</a></li>
    <li><a href="/bar" v-pjax:content>Bar</a></li>
</ul>

<pjax-container name="content">
    Hello world!
</pjax-container>

<!-- `v-pjax` can also be bound to form submits. -->

<pjax-container name="my-form">
    <form method="post" v-pjax:my-form>
        <!-- ... -->
    </form>
</pjax-container>

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment you are required to send us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Installation

You can install the package via npm:

$ npm install vue-pjax

This package requires your application to provide two peerDependencies: vue and vue-resource.

$ npm install vue@'^1.0.24' vue-resource@'^0.7.4'

Usage

To enable the pjax component and directive, the easiest way is to register the mixin in your root component:

import Vue from 'vue';
import VueResource from 'vue-resource';
import pjax from 'vue-pjax';

Vue.use(VueResource);

new Vue({
    el: 'body',
    mixins: [pjax],
});

If you prefer global components, you'll have to register them separately:

import { PjaxContainer, pjax } from 'vue-pjax';
import Vue from 'vue';
import VueResource from 'vue-resource';

Vue.use(VueResource);

Vue.component('pjax-container', PjaxContainer);
Vue.directive('pjax', pjax);
<pjax-container name="my-dynamic-section">
    No one
</pjax-container>
<a href="/hodor" v-pjax:my-dynamic-section>
    Replace 'No one' with Hodor's contents
</a>
<a href="/bran" v-pjax:my-dynamic-section>
    Replace 'No one' with Bran's contents
</a>

Forms:

<pjax name="my-dynamic-form">
    <form action="/submit" v-pjax:my-dynamic-form>
        <!-- Form submissions will replace `my-dynamic-form` with the server's response -->
    </form>
</pjax>

Why Vue?

  • Events
  • Resource
  • Recompilation

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please contact Freek Van der Herten instead of using the issue tracker.

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

The MIT License (MIT). Please see License File for more information.