Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typscriptproblem: VueJsonPretty has type App<any> & ... #245

Open
LuWa-at-work opened this issue Apr 21, 2023 · 2 comments
Open

Typscriptproblem: VueJsonPretty has type App<any> & ... #245

LuWa-at-work opened this issue Apr 21, 2023 · 2 comments

Comments

@LuWa-at-work
Copy link

I get following errormessage in vscode when i use the -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.
image

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/node@18.14.0
├── @typescript-eslint/eslint-plugin@5.52.0
├── @typescript-eslint/parser@5.52.0
├── @vitejs/plugin-vue@4.0.0
├── @vue/eslint-config-typescript@11.0.2
├── eslint-config-prettier@8.6.0
├── eslint-plugin-vue@9.9.0
├── eslint@8.34.0
├── prettier@2.8.4
├── sass@1.58.3
├── typescript@4.9.5
├── vite@4.1.1
├── vue-json-pretty@2.2.4
├── vue-router@4.1.6
├── vue-tsc@1.1.4
└── vue@3.2.47

@dili021
Copy link

dili021 commented Apr 25, 2023

Getting the same error

@leezng
Copy link
Owner

leezng commented May 4, 2023

Sorry, I ran the demo code without reproducing the problem, can anyone provide more detailed information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants