plantain-00 / schema-based-json-editor

A reactjs and vuejs component of schema based json editor.
MIT License
168 stars 38 forks source link

All buttons are not rendered correctly. #11

Closed 1yefuwang1 closed 6 years ago

1yefuwang1 commented 6 years ago

Version(if relevant): 7.7.3

Environment(if relevant): Mac Chrome Version 64.0.3282.186 (Official Build) (64-bit), Vue 2.5.2, theme: bootstrap4, icon: null

Expected:

Buttons in the vue.js example are rendered correctly. For instance, the collapse button that comes with the arrayExample is rendered as follows. image

Actual:

When playing with this library, my buttons are not rendered correctly. image So visually, all buttons are not visible on the rendered page.

plantain-00 commented 6 years ago

Can you try icon=undefined? It seems icon=null is not handled correctly.

1yefuwang1 commented 6 years ago

After changing icon to 'element-ui2', the rendered buttons are as follows. image Whereas the same configuration in the demo gives me: image

I don't have much insights to offer, but the following things are worth mentioning:

  1. The magic number data-v-5cf26f6a keeps popping up.
  2. The value of text attribute is definitely wrongly rendered.
plantain-00 commented 6 years ago

I haven't meet this problem, can you provide a reproducible demo about this? a jsfiddle one is enough.

1yefuwang1 commented 6 years ago

I'm trying to reproduce, but having trouble to get this component working with jsfiddle. Can you please provide a working jsfiddle example? Or could you please make the following jsfiddle session working?

plantain-00 commented 6 years ago

This one is good to go: https://jsfiddle.net/ujz15hr9/1/

The document shows how to use it as script tags: https://github.com/plantain-00/schema-based-json-editor#vuejs-component

1yefuwang1 commented 6 years ago

I have found the bug. It seems my vue project has a globally registered component named 'icon', which happens to share the same name of the button component of this library('icon').

plantain-00 commented 6 years ago

v7.7.5 registers inner component icon locally now.