This commit is contained in:
syuilo 2018-02-24 06:29:21 +09:00
parent 48341db13d
commit 482c86a25a
5 changed files with 67 additions and 4 deletions

View file

@ -34,19 +34,20 @@ export default function<T extends object>(data: {
}
this.$watch('props', newProps => {
const w = (this as any).os.i.client_settings.mobile_home.find(w => w.id == this.id);
if (this.isMobile) {
(this as any).api('i/update_mobile_home', {
id: this.id,
data: newProps
}).then(() => {
(this as any).os.i.client_settings.mobile_home.find(w => w.id == this.id).data = newProps;
w.data = newProps;
});
} else {
(this as any).api('i/update_home', {
id: this.id,
data: newProps
}).then(() => {
(this as any).os.i.client_settings.home.find(w => w.id == this.id).data = newProps;
w.data = newProps;
});
}
}, {