A Simple Plugin to Deal with SessionStorage on Vue.js
npm install vue-sessionstorageThis plugin is ready to work with Unit Tests mocking the sessionStorage.
```
npm install --save vue-sessionstorage
Put in your main.js
`javascript`
import VueSessionStorage from 'vue-sessionstorage'
Vue.use(VueSessionStorage)
Let's suppose you are building a login system
`javascript``
export default {
name: 'login',
methods: {
doLogin() {
axios.post('/login', {...}).then(response => {
let username = response.data.username;
this.$session.set('username', username); // Set the username in session Storage
});
}
}
}