fixed cookie reactivity
This commit is contained in:
parent
b74fdb3825
commit
aa2d0eafb1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -322,18 +322,20 @@ export default {
|
||||
mounted() {
|
||||
this.$nextTick(function () {
|
||||
if (this.$cookies.isKey(SETTINGS_COOKIE_NAME)) {
|
||||
let cookie_val = this.$cookies.get(SETTINGS_COOKIE_NAME)
|
||||
for (let i of Object.keys(cookie_val)) {
|
||||
this.$set(this.settings, i, cookie_val[i])
|
||||
}
|
||||
//TODO i have no idea why the above code does not suffice to update the
|
||||
//TODO pagination UI element as $set should update all values reactively but it does not
|
||||
setTimeout(function () {
|
||||
this.$set(this.settings, 'pagination_page', 0)
|
||||
}.bind(this), 50)
|
||||
setTimeout(function () {
|
||||
this.$set(this.settings, 'pagination_page', cookie_val['pagination_page'])
|
||||
}.bind(this), 51)
|
||||
this.settings = Object.assign({}, this.settings, this.$cookies.get(SETTINGS_COOKIE_NAME))
|
||||
// let cookie_val = this.$cookies.get(SETTINGS_COOKIE_NAME)
|
||||
|
||||
// for (let i of Object.keys(cookie_val)) {
|
||||
// this.$set(this.settings, i, cookie_val[i])
|
||||
// }
|
||||
// //TODO i have no idea why the above code does not suffice to update the
|
||||
// //TODO pagination UI element as $set should update all values reactively but it does not
|
||||
// setTimeout(function () {
|
||||
// this.$set(this.settings, 'pagination_page', 0)
|
||||
// }.bind(this), 50)
|
||||
// setTimeout(function () {
|
||||
// this.$set(this.settings, 'pagination_page', cookie_val['pagination_page'])
|
||||
// }.bind(this), 51)
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user