mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
refactor(editor): Migrate VersionCard.vue
to use composition API (no-changelog) (#9799)
This commit is contained in:
parent
f6b8b8d956
commit
106b0ac1a0
|
@ -44,36 +44,30 @@
|
||||||
v-for="node in version.nodes"
|
v-for="node in version.nodes"
|
||||||
:key="node.name"
|
:key="node.name"
|
||||||
:node-type="node"
|
:node-type="node"
|
||||||
:title="$options.nodeName(node)"
|
:title="nodeName(node)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import type { PropType } from 'vue';
|
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import NodeIcon from './NodeIcon.vue';
|
import NodeIcon from './NodeIcon.vue';
|
||||||
import TimeAgo from './TimeAgo.vue';
|
import TimeAgo from './TimeAgo.vue';
|
||||||
import Badge from './Badge.vue';
|
import Badge from './Badge.vue';
|
||||||
import WarningTooltip from './WarningTooltip.vue';
|
import WarningTooltip from './WarningTooltip.vue';
|
||||||
import type { IVersionNode, IVersion } from '@/Interface';
|
import type { IVersion, IVersionNode } from '@/Interface';
|
||||||
|
import { useI18n } from '@/composables/useI18n';
|
||||||
|
|
||||||
export default defineComponent({
|
defineProps<{
|
||||||
name: 'VersionCard',
|
version: IVersion;
|
||||||
components: { NodeIcon, TimeAgo, Badge, WarningTooltip },
|
}>();
|
||||||
props: {
|
|
||||||
version: {
|
const i18n = useI18n();
|
||||||
type: Object as PropType<IVersion>,
|
|
||||||
required: true,
|
const nodeName = (node: IVersionNode): string => {
|
||||||
},
|
return node !== null ? node.displayName : i18n.baseText('versionCard.unknown');
|
||||||
},
|
};
|
||||||
// @ts-ignore
|
|
||||||
nodeName(node: IVersionNode): string {
|
|
||||||
return node !== null ? node.displayName : this.$locale.baseText('versionCard.unknown');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style module lang="scss">
|
<style module lang="scss">
|
||||||
|
|
Loading…
Reference in a new issue