From e2498d6f90ccd8f9fe90f141c72953a4b1e41915 Mon Sep 17 00:00:00 2001 From: chadmin Date: Fri, 18 Oct 2024 11:28:08 -0700 Subject: [PATCH] feat(json-to-csv) add example default value --- src/tools/json-to-csv/json-to-csv.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/json-to-csv/json-to-csv.vue b/src/tools/json-to-csv/json-to-csv.vue index e2f5ddb6..0f02bce9 100644 --- a/src/tools/json-to-csv/json-to-csv.vue +++ b/src/tools/json-to-csv/json-to-csv.vue @@ -4,6 +4,8 @@ import { convertArrayToCsv } from './json-to-csv.service'; import type { UseValidationRule } from '@/composable/validation'; import { withDefaultOnError } from '@/utils/defaults'; +const defaultValue = '[\n {\n "Age": 18,\n "Country": "Germany",\n "Gender": "Male",\n "Purchased": "N",\n "Salary": 20000\n },\n {\n "Age": 19,\n "Country": "France",\n "Gender": "Female",\n "Purchased": "N",\n "Salary": 22000\n },\n {\n "Age": 20,\n "Country": "England",\n "Gender": "Female",\n "Purchased": "N",\n "Salary": 24000\n }\n]'; + function transformer(value: string) { return withDefaultOnError(() => { if (value === '') { @@ -24,6 +26,7 @@ const rules: UseValidationRule[] = [