Refactor widgets and fix lint issues (#8719)

* fix(client): refactor widgets and fix lint issues

* Apply review suggestions from @Johann150

Co-authored-by: Johann150 <johann@qwertqwefsday.eu>

Co-authored-by: Johann150 <johann@qwertqwefsday.eu>
This commit is contained in:
Andreas Nedbal 2022-05-25 09:43:12 +02:00 committed by GitHub
parent 81fccb5656
commit b049633db7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 261 additions and 318 deletions

View file

@ -50,7 +50,7 @@ type WidgetProps = GetFormResultType<typeof widgetPropsDef>;
//const props = defineProps<WidgetComponentProps<WidgetProps>>();
//const emit = defineEmits<WidgetComponentEmits<WidgetProps>>();
const props = defineProps<{ widget?: Widget<WidgetProps>; }>();
const emit = defineEmits<{ (e: 'updateProps', props: WidgetProps); }>();
const emit = defineEmits<{ (ev: 'updateProps', props: WidgetProps); }>();
const { widgetProps, configure, save } = useWidgetPropsManager(name,
widgetPropsDef,
@ -65,7 +65,7 @@ os.api('server-info', {}).then(res => {
});
const toggleView = () => {
if (widgetProps.view == 4) {
if (widgetProps.view === 4) {
widgetProps.view = 0;
} else {
widgetProps.view++;