Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

vue-update

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

vue-update

provides extra hook for data-updating

    1.0.6latest

Version published
Maintainers
1
Yearly downloads
3,882
increased by5.23%

Weekly downloads

Readme

Source

vue-update npm package Downloads

Requires Vuejs 2.0

Must works with vue-router

You can use it to manually control whether data should be updated when route enters, or do some things else.

It can be helpful in some cases, especially in 'keep-alive' mode.

Install

$ npm install vue-update --save-dev

main.js:

import Vue from 'vue' import VueRouter from 'vue-router' import VueUpdate from 'vue-update' Vue.use(VueRouter) Vue.use(VueUpdate)

usage

see /example

$ npm install $ npm run dev

Use this.$pushToUpdate('/foo') to push a route path into the updateQueue.

In bar.vue:

// push the route which needs to update this.$pushToUpdate('/foo') // you can also pass the route name this.$pushToUpdate('foo')

Then when you navigate to a route the matches anyone in the updateQueue, the hook function update(){} in the target route will trigger.

In foo.vue:

export default { data(){ return { msg: '' } }, update(){ // do something this.msg = 'foo' // once triggerd, '/foo' will be removed from the list } }

Keywords

FAQs

What is vue-update?

provides extra hook for data-updating

Is vue-update popular?

The npm package vue-update receives a total of 77 weekly downloads. As such, vue-update popularity was classified as not popular.

Is vue-update well maintained?

We found that vue-update demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 25 Dec 2016
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc