Skip to content

Commit 83a78e9

Browse files
committed
fix: better display
1 parent e10beda commit 83a78e9

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

components.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,20 @@ declare module '@vue/runtime-core' {
131131
NA: typeof import('naive-ui')['NA']
132132
NAlert: typeof import('naive-ui')['NAlert']
133133
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
134+
NCode: typeof import('naive-ui')['NCode']
134135
NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
135136
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
136137
NEllipsis: typeof import('naive-ui')['NEllipsis']
138+
NFormItem: typeof import('naive-ui')['NFormItem']
137139
NH1: typeof import('naive-ui')['NH1']
138140
NH3: typeof import('naive-ui')['NH3']
139141
NIcon: typeof import('naive-ui')['NIcon']
142+
NInputNumber: typeof import('naive-ui')['NInputNumber']
140143
NLayout: typeof import('naive-ui')['NLayout']
141144
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
142145
NMenu: typeof import('naive-ui')['NMenu']
146+
NScrollbar: typeof import('naive-ui')['NScrollbar']
147+
NSwitch: typeof import('naive-ui')['NSwitch']
143148
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
144149
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
145150
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']

src/tools/json-linter/json-linter.vue

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ const jsonContent = ref(
88
}`,
99
);
1010
11-
const conversionResult = computed(() => {
11+
const conversionError = computed(() => {
1212
try {
1313
linter.parse(jsonContent.value);
14-
return JSON.stringify(JSON.parse(jsonContent.value), null, 2);
14+
return null;
1515
}
1616
catch (e: any) {
17-
return e.toString().split('\n').map((err: string) => ({ line: -1, message: err, helpLink: '' }));
17+
return e.toString();
1818
}
1919
});
2020
21-
const errors = computed(() => conversionResult.value);
22-
2321
const MONACO_EDITOR_OPTIONS = {
2422
automaticLayout: true,
2523
formatOnType: true,
@@ -41,15 +39,11 @@ const MONACO_EDITOR_OPTIONS = {
4139
</div>
4240
</c-label>
4341

44-
<div v-if="errors.length > 0">
42+
<div v-if="conversionError">
4543
<n-alert title="The following errors occured" type="error" mt-5>
46-
<ul>
47-
<li v-for="(message, index) of errors" :key="index">
48-
{{ message.message }} (<n-a v-if="message.helpLink" target="_blank" rel="noreferer noopener">
49-
See JSON help
50-
</n-a>)
51-
</li>
52-
</ul>
44+
<pre>
45+
{{ conversionError }}
46+
</pre>
5347
</n-alert>
5448
</div>
5549
<div v-else>

0 commit comments

Comments
 (0)