Collection of handy online tools for developers, with great UX.
TypeScript converterdeveloper-productivitydeveloper-toolsfrontendjavascriptproductivitytooltoolstypescriptvuejswebsite
refactor(json-viewer): add clear button
Corentin Thomasset048bc4ae9435
diff --git a/src/tools/json-viewer/json-viewer.vue b/src/tools/json-viewer/json-viewer.vueindex 3307cba3..55352821 100644--- a/src/tools/json-viewer/json-viewer.vue+++ b/src/tools/json-viewer/json-viewer.vue@@ -5,8 +5,21 @@:feedback="rawJsonValidation.message":validation-status="rawJsonValidation.status">- <n-input v-model:value="rawJson" class="json-input" type="textarea" placeholder="Paste your raw json here..." />+ <n-input+ v-model:value="rawJson"+ class="json-input"+ type="textarea"+ placeholder="Paste your raw json here..."+ autocomplete="off"+ autocorrect="off"+ autocapitalize="off"+ spellcheck="false"+ /></n-form-item>++ <n-space justify="center">+ <n-button secondary @click="rawJson = ''">Clear</n-button>+ </n-space></n-card><n-card v-if="cleanJson.length > 0">@@ -39,7 +52,7 @@ const rawJsonValidation = useValidation({source: rawJson,rules: [{- validator: (v) => JSON.parse(v),+ validator: (v) => v === '' || JSON.parse(v),message: 'Invalid json string',},],