mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 22:17:30 -07:00
Refactor analog clock widget (#2648)
This commit is contained in:
parent
f6fe8a9097
commit
0395ee5067
1 changed files with 4 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="mkw-analog-clock">
|
<div class="mkw-analog-clock">
|
||||||
<mk-widget-container :naked="!(props.design % 2)" :show-header="false">
|
<mk-widget-container :naked="props.style % 2 === 0" :show-header="false">
|
||||||
<div class="mkw-analog-clock--body">
|
<div class="mkw-analog-clock--body">
|
||||||
<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="!(props.design && ~props.design)"/>
|
<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="props.style < 2"/>
|
||||||
</div>
|
</div>
|
||||||
</mk-widget-container>
|
</mk-widget-container>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,13 +13,12 @@ import define from '../../../common/define-widget';
|
||||||
export default define({
|
export default define({
|
||||||
name: 'analog-clock',
|
name: 'analog-clock',
|
||||||
props: () => ({
|
props: () => ({
|
||||||
design: -1
|
style: 0
|
||||||
})
|
})
|
||||||
}).extend({
|
}).extend({
|
||||||
methods: {
|
methods: {
|
||||||
func() {
|
func() {
|
||||||
if (++this.props.design > 2)
|
this.props.style = (this.props.style + 1) % 4;
|
||||||
this.props.design = -1;
|
|
||||||
this.save();
|
this.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue