Get or set local storage value in Vue Grid component

16 Mar 20231 minute to read

If the enablePersistence property set as true,The Grid property value is saved in the window.localStorage for reference. You can get/set the localStorage value by using the getItem/setItem method in window.localStorage.

//get the Grid model.
let value = window.localStorage.getItem('gridGrid'); //"gridGrid" is component name + component id.
let model = JSON.parse(model);
//set the Grid model.
window.localStorage.setItem('gridGrid', JSON.stringify(model)); //"gridGrid" is component name + component id.