yansenlei / VJsoneditor

:large_blue_diamond: vue use jsoneditor
https://yansenlei.github.io/VJsoneditor/
Apache License 2.0
182 stars 45 forks source link

Vue 3 #42

Open Stebeber opened 3 years ago

Stebeber commented 3 years ago

Hey, is the component ready to be used in Vue3 projects? I want to use it in an electron application but I receive various errors during rendering.

I am quite new to Vue.js, therefor I am not sure if the problem is on my side.

Regards

image

<template>
  <img alt="Vue logo" src="./assets/logo.png">
  <HelloWorld msg="Welcome to Your Vue.js App"/>
  <v-jsoneditor v-model="json" height="400px"/>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue';
import VJsoneditor from 'v-jsoneditor'

export default {
  name: 'App',
  data () {
      return {
        json: {
          msg: 'demo of jsoneditor'
        }
      }
    },
  components: {
    HelloWorld,
    VJsoneditor    
  },
  methods: {
      onJsonChange (value) {
        console.log('value:', value)
      }
    }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
Evertvdw commented 3 years ago

I just came here to look for this same issue, so I guess the component is not ready for Vue3 atm. Are there plans for this?

yansenlei commented 3 years ago

This component has plans to support vue3, Please wait. :blush:

Evertvdw commented 3 years ago

@yansenlei Any chance you can give a timeline?

HzAlen commented 3 years ago

Recently no jsoneditor support vue3 properly, some doesn't have template to import and others have bug,please update. I'm a back-end programmer and my vue technology is poor.

yansenlei commented 3 years ago

in progress...

vaasav-kumar commented 2 years ago

is this supported now in vue3?

pratik227 commented 1 year ago

https://www.npmjs.com/package/v3-jsoneditor

Just published the package for Vue 3.