refactor(editor): Replace mixed style of defineProps with the new style (no-changelog) (#9787)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-06-18 09:55:10 +02:00
committed by GitHub
parent 1e8716a607
commit 08c6e9b571
27 changed files with 161 additions and 277 deletions

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup>
/* eslint-disable @typescript-eslint/naming-convention */
import type { PropType } from 'vue';
import { computed, toRefs } from 'vue';
import VueMarkdown from 'vue-markdown-render';
import hljs from 'highlight.js/lib/core';
@@ -9,12 +8,9 @@ import type MarkdownIt from 'markdown-it';
import type { ChatMessage, ChatMessageText } from '@n8n/chat/types';
import { useOptions } from '@n8n/chat/composables';
const props = defineProps({
message: {
type: Object as PropType<ChatMessage>,
required: true,
},
});
const props = defineProps<{
message: ChatMessage;
}>();
const { message } = toRefs(props);
const { options } = useOptions();

View File

@@ -1,15 +1,16 @@
<script lang="ts" setup>
import type { PropType } from 'vue';
import { computed } from 'vue';
import { Message } from './index';
import type { ChatMessage } from '@n8n/chat/types';
const props = defineProps({
animation: {
type: String as PropType<'bouncing' | 'scaling'>,
default: 'bouncing',
const props = withDefaults(
defineProps<{
animation?: 'bouncing' | 'scaling';
}>(),
{
animation: 'bouncing',
},
});
);
const message: ChatMessage = {
id: 'typing',

View File

@@ -1,16 +1,12 @@
<script lang="ts" setup>
import type { PropType } from 'vue';
import Message from '@n8n/chat/components/Message.vue';
import type { ChatMessage } from '@n8n/chat/types';
import MessageTyping from '@n8n/chat/components/MessageTyping.vue';
import { useChat } from '@n8n/chat/composables';
defineProps({
messages: {
type: Array as PropType<ChatMessage[]>,
required: true,
},
});
defineProps<{
messages: ChatMessage[];
}>();
const chatStore = useChat();