mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-05 02:08:14 +09:00
refactor(frontend): reduce type errors
This commit is contained in:
parent
fa9c4a19b9
commit
2cd32b2248
@ -140,8 +140,8 @@ const profile = reactive({
|
||||
location: $i.location,
|
||||
birthday: $i.birthday,
|
||||
lang: $i.lang,
|
||||
isBot: $i.isBot,
|
||||
isCat: $i.isCat,
|
||||
isBot: $i.isBot ?? false,
|
||||
isCat: $i.isCat ?? false,
|
||||
});
|
||||
|
||||
watch(() => profile, () => {
|
||||
|
@ -225,7 +225,10 @@ export class Storage<T extends StateDef> {
|
||||
* 特定のキーの、簡易的なgetter/setterを作ります
|
||||
* 主にvue場で設定コントロールのmodelとして使う用
|
||||
*/
|
||||
public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]) {
|
||||
public makeGetterSetter<K extends keyof T>(key: K, getter?: (v: T[K]) => unknown, setter?: (v: unknown) => T[K]): {
|
||||
get: () => T[K]['default'];
|
||||
set: (value: T[K]['default']) => void;
|
||||
} {
|
||||
const valueRef = ref(this.state[key]);
|
||||
|
||||
const stop = watch(this.reactiveState[key], val => {
|
||||
|
Loading…
Reference in New Issue
Block a user