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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-modified

v1.0.0

Published

A simple directive plugin for [Vue 0.11.x](http://vuejs.org/) that lets you know when your v-models have been modified. Based off of [Vue Validator](https://github.com/xrado/vue-validator) by Radovan Lozej.

Readme

vue-modified

A simple directive plugin for Vue 0.11.x that lets you know when your v-models have been modified. Based off of Vue Validator by Radovan Lozej.

Getting Started

With CommonJS:

var Vue = require('vue'),
    modified = require('vue-modified');

Vue.use(modified);

Standard Usage:

<script type="text/javascript" src="vue.modified.js"></script>

Usage

This plugin is only able to work with elements that you can use v-model with (input, select, textarea, etc) and components.

<input type="text" v-model="email" v-modified>

or with a component:

<mycomponent model="name" v-modified></mycomponent>

With components, you need to provide a special attribute called model with the same content you would place in any other v-model.

If you do not provide the v-modified attribute, this field will not be included in the checks and will not be reported when checking the status of the form.

v-modified Directive

<element v-model="MODEL_NAME" v-modified="GROUP_NAME"> <!-- With group name -->
<element v-model="MODEL_NAME" v-modified> <!-- Without group name -->

This directive may take one argument of a group name. When a group name is provided, it gives the ability to get modified status based on group name and reset the modified status based on group.

Exposed Methods

All exposed methods are available under the create Vue instance that have at least 1 element that contains the v-modified flag.

vm.$modified([group])

Returns Boolean

Whether the form has been modified. Optional group argument may be used to get the modified status for only the fields in that group.

vm.$modified();
vm.$modified('myGroup'); // by group name

vm.$touched([group])

Returns Boolean

Whether any of the fields have been touched on the form. Touching means the value has been at least changed once, even if it is reverted back to it's original value by the user. Optional group argument may be used to get the touched status for only the fields in the provided group.

vm.$touched();
vm.$touched('myGroup'); // by group name

vm.$resetModified([group])

Returns undefined

Resets the modified status of the fields on the form. When the status is reset, it will set modified: false under each field in vm.vmodified along with resetting the internal variable that stores the original value to the fields current value. This is useful if the form is saved via AJAX or an external method is used for resetting/clearing the values in the form. Optional group argument may be used to reset the modified status for only the fields in the provided group.

vm.$resetModified(); // Resets the modified status for entire form
vm.$resetModified('groupName'); // By group only

vm.$modifiedItems([group])

Returns Array

Returns a list of the items being watched by Vue Modified from vm.vmodified. Optional group argument may be used to only return items for that provided group name. If there are no items found, it will return an empty array.

vm.$modifiedItems();
=> [...]

vm.$modifiedItems('groupName'); // By group only
=> [...]

Instance Properties

The properties that will be added to the Vue instance when at least one element has the v-modified attribute.

vm.vmodified

Type Object | Alias for vm.$data.vmodified

Contains the configuration and status for all the fields being watched by Vue Modified. This keypath can be changed, see configuration below.

Configuration

The following can be globally configured for Vue Modified.

Vue.config.modifiedPath

Type String | Default 'vmodified'

The base keypath name to use to store the field configuration and status under.

License

Licensed under MIT. See LICENSE in the repository.

Demo

You can view the demo for Vue Modified at the following link:

http://kyleross.github.io/vue-modified/

Todo

  • Write some tests
  • Add method to reset form values
  • Cleanup and performance tweaks

Contributing

If you find any issues or want to add any new features, please feel free to do so and submit a pull request. Once tests are in place, please make sure to run the tests and that they pass before submitting the pull request.