Reactive state cookie
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import cookie from './cookie.mjs';
|
||||
import { state } from './vistax.mjs';
|
||||
|
||||
import ViewResourceLookup from './ViewResourceLookup.vue';
|
||||
import DateRangePicker from './DateRangePicker.vue';
|
||||
@@ -37,7 +37,7 @@
|
||||
client: Object
|
||||
},
|
||||
data() {
|
||||
var resources = cookie.get('vista.resources');
|
||||
var resources = state.resources;
|
||||
return {
|
||||
selection: resources ? (resources.split(',').filter(x => x) || []) : [],
|
||||
date: dateonly(new Date()),
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
watch: {
|
||||
selection(value, oldvalue) {
|
||||
cookie.set('vista.resources', value.join(','), 7);
|
||||
state.resources = value.join(',');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user