KlausSchaefers / vue-low-code

Quant-UX standalone
MIT License
364 stars 42 forks source link

How to develop custom components for Vue-low-code? #40

Closed konglinghai123 closed 2 years ago

konglinghai123 commented 2 years ago

I already know how to design my application through quant UX, but I want to add my components to quant UX. I guess I want to complete the following:

  1. Develop a component (type: a) in quant UX project.

  2. A component (type: a) is also developed in the Vue low code project.

Could you please provide some detailed documentation?

KlausSchaefers commented 2 years ago

Hi,

this is a bit tricky:

1) In Quant-UX you need to create a custom component.

Here is more info: https://quant-ux.com/#/opensource.html

2) In VUE-LOW-CODE it is easier.

If you manage to use a VUE template, you should be able to copy most of the widget.

KlausSchaefers commented 2 years ago

What Kind of component do you want to build?

konglinghai123 commented 2 years ago

I want to define very complex components, such as complex and beautiful page.

KlausSchaefers commented 2 years ago

Hi, for this you could also try to use just the normal templating system. You could just create a new template file and create a group element. Take a look here:

https://github.com/KlausSchaefers/quant-ux/blob/master/src/themes/lightning/modal.json

This is a modal dialog with some constraints in it, so it behaves responsive.

KlausSchaefers commented 2 years ago

These template groups are build of simple components that are already supported in Vue-Low-Code

konglinghai123 commented 2 years ago

In my case, my application page UI/UX design is defined on Quant-UX. Users can modify or add new pages through Quant-UX. Can this requirement be realized?

KlausSchaefers commented 2 years ago

Yes that should be possible. You can also define screens as templates.

konglinghai123 commented 2 years ago

How to define screens as templates. Could you please give me some guidance?

KlausSchaefers commented 2 years ago

Hi, I just checked. I still need to fix some stuff in quant-ux for this. Should not take long.

konglinghai123 commented 2 years ago

Looking forward to the new features of the project, don't forget to tell me.Thank you!

KlausSchaefers commented 2 years ago

Hi,

can you checkout at latest version of Quant-UX. It should support now screens with widgets. You need to

1) Create a template file. Here is an example https://github.com/KlausSchaefers/quant-ux/blob/master/src/themes/screensAndWidgets.json

2) Register the template file in the SymbolService: https://github.com/KlausSchaefers/quant-ux/blob/master/src/services/SymbolService.js

3) If you want to add new categories or change the size of the preview take a look at https://github.com/KlausSchaefers/quant-ux/blob/master/src/canvas/toolbar/components/CreateButton.vue

You can get the JSON for the template file by enabling "Ninja" mode..

1) Double click on the toolbar,

2)Select the screen

3) Click the Ninja Icon

4) Copy JSON

You might notice this is the same structure as the default app JSON. You could also dev tools to check the rest requests.

NinjaMode

Does this help?

konglinghai123 commented 2 years ago

My idea is to define all the screens of my application in quant UX, and I can let my users modify my application page. But this screen with widgets function doesn't seem to be satisfied, right? I'm not sure?

KlausSchaefers commented 2 years ago

If you use this mechanism, the screens will appear in the widget creation dialog. If you want to start with a set of screens the best would be to just create the prototypes and then us the the saveAs functionality to create a copy. If this does not help, could you explain your use case in more detail? Which are the steps you want your users to take?