Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to parse strings into string JSON #22

Open
seungdeok opened this issue Jul 1, 2024 · 1 comment
Open

How to parse strings into string JSON #22

seungdeok opened this issue Jul 1, 2024 · 1 comment

Comments

@seungdeok
Copy link

I am using this library.
when I used value used json.stringfy, I convert easy json value. exmaple) parse option.

<template>
  <JsonViewer :value="jsonData" copyable boxed sort theme="light"  @onKeyClick="keyClick"/>
  <!-- example parse -->
  <JsonViewer parse :value="jsonStringData" copyable boxed sort theme="dark"  @onKeyClick="keyClick"/>
</template>

<script setup>
  let obj = {
    name: "qiu",//string
    age: 18,//Array
    isMan:false,//boolean
    date:new Date(),
    fn:()=>{},
    arr:[1,2,5],
    reg:/ab+c/i
  };
  const jsonData = reactive(obj);
  const jsonStringData = reactive(obj);
</script>

I want to equal jsonData and jsonStringData.

if you have no plan yet but need, maybe I can contribute?

@qiuquanwu
Copy link
Owner

I am using this library. when I used value used json.stringfy, I convert easy json value. exmaple) parse option.

<template>
  <JsonViewer :value="jsonData" copyable boxed sort theme="light"  @onKeyClick="keyClick"/>
  <!-- example parse -->
  <JsonViewer parse :value="jsonStringData" copyable boxed sort theme="dark"  @onKeyClick="keyClick"/>
</template>

<script setup>
  let obj = {
    name: "qiu",//string
    age: 18,//Array
    isMan:false,//boolean
    date:new Date(),
    fn:()=>{},
    arr:[1,2,5],
    reg:/ab+c/i
  };
  const jsonData = reactive(obj);
  const jsonStringData = reactive(obj);
</script>

I want to equal jsonData and jsonStringData.

if you have no plan yet but need, maybe I can contribute?

I think your idea is good, you can contribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants