vue-json-pretty
vue-json-pretty copied to clipboard
Typscriptproblem: VueJsonPretty has type `App<any> & ...`
I get following errormessage in vscode when i use the <VueJsonPretty/>-component:
Das Argument vom Typ "{ data: JSONDataType; showLine: false; "show-line": boolean; showIcon: true; "show-icon": boolean; deep: number; }" kann dem Parameter vom Typ "App<any> & Partial<{ data: JSONDataType; showLength: boolean; showDoubleQuotes: boolean; showSelectController: boolean; showLine: boolean; showLineNumber: boolean; selectOnClickNode: boolean; ... 13 more ...; collapsedOnClickBrackets: boolean; }> & Omit<...> & Record<...>" nicht zugewiesen werden.
Im Typ "{ data: JSONDataType; showLine: false; "show-line": boolean; showIcon: true; "show-icon": boolean; deep: number; }" fehlen die folgenden Eigenschaften von Typ "App<any>": "version, config, use, mixin" und 11 weitere.ts(2345)
It seems it thinks the component has also the App<any>
Type and requires a few more parameters.
code from my Component:
<script setup lang="ts">
import VueJsonPretty from 'vue-json-pretty';
import { JSONDataType } from 'vue-json-pretty/types/utils';
interface Props {
name: string;
result: { data: unknown; error: unknown };
}
defineProps<Props>();
</script>
<template>
<h3>{{ name }}</h3>
<div class="response">
<VueJsonPretty
:data="result.data as JSONDataType"
:show-line="false"
:show-icon="true"
:deep="1"
/>
</div>
<div class="error">
{{ result.error }}
</div>
</template>
strangly on the ES-Lint run this doesn`t show up 🤔 Versions:
╰─⩥ npm list
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── @vitejs/[email protected]
├── @vue/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Getting the same error
Sorry, I ran the demo code without reproducing the problem, can anyone provide more detailed information?