mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
fix json editor lint
This commit is contained in:
parent
7644aa5ffa
commit
a7d330d062
1 changed files with 44 additions and 38 deletions
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<JsonEditorVue
|
||||
:modelValue="modelValue"
|
||||
:model-value="modelValue"
|
||||
v-bind="$attrs"
|
||||
:style="{ height }"
|
||||
:stringified="false"
|
||||
|
@ -8,28 +8,29 @@
|
|||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
import JsonEditorVue from 'json-editor-vue'
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import JsonEditorVue from "json-editor-vue";
|
||||
|
||||
const props = defineProps({
|
||||
export default defineComponent({
|
||||
name: "RecipeJsonEditor",
|
||||
components: { JsonEditorVue },
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '1500px',
|
||||
default: "1500px",
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
function parseEvent(event: any): object {
|
||||
},
|
||||
emits: ["update:modelValue"],
|
||||
setup(_, { emit }) {
|
||||
function parseEvent(event: any): object {
|
||||
if (!event) {
|
||||
return {};
|
||||
}
|
||||
|
||||
try {
|
||||
if (event.json) {
|
||||
return event.json;
|
||||
|
@ -40,12 +41,17 @@ function parseEvent(event: any): object {
|
|||
else {
|
||||
return event;
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function onChange(event: any) {
|
||||
emit('update:modelValue', parseEvent(event));
|
||||
}
|
||||
}
|
||||
function onChange(event: any) {
|
||||
emit("update:modelValue", parseEvent(event));
|
||||
}
|
||||
return {
|
||||
onChange,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue