Replies: 4 comments 4 replies
-
You can start with the trame cookiecutter while picking the "component" option. That will generate both the JS project and the Python side. The JS code in the cookiecutter will be pure JS to work in both vue2 and vue3. But if you are fine to limit yourself to only 1 vue version, you can replace the JS file by a You can see a usage of those widgets in any repo HTH |
Beta Was this translation helpful? Give feedback.
-
Side note, if you write any JS-Script-Function, it will still execute on the client. Even creating a pure Python component, will execute on the client side letting vue compile and run it for you. |
Beta Was this translation helpful? Give feedback.
-
You can see an example of a trame library created using the cookiecutter ("component" option) here: trame-alerts. In this library all the custom vue components are implemented as SFC using typescript (which required further tweaks to the build system straight out of the cookiecutter). |
Beta Was this translation helpful? Give feedback.
-
Dear Sebastien, dear Alessandro thanks for your reply, but cookiecutter seems not be a solution for me. I started programming webapps with trame and vuetify and got along with this pretty fast. My idea to use .vue or JS is just to add some more functions to (sets of) components. Let me give an example: I know, that this is better done using the "rules"-section of the text-field, but this example is most At first, I tried to make this work by using a template with an additional "script"-section:
and added this in my trame-code with: I made different attempts to get this running, but it seems to me, that the script-section In the best case, clicking on the Button lead to a message in the console: I'm not really interested in .vue-files, all I want to achieve, is to run simple support-functions, cookiecutter may be a great project, but for me, it is more efficient to spend my time learing JS Thanks a lot and best regards, MagX |
Beta Was this translation helpful? Give feedback.
-
Dear Trame-Community,
from #199 (reply in thread) I learned that Components from .vue-files can also be used with trame.
Is there any basic example for this; I'm unable to finde any futher information on this topic, than in the link above?
There are many examples on https://vuejs.org/guide/essentials/component-basics.html#Dynamic-Components how to
write SRCs, but how to proceed with trame after doing so?
I know, that any JS-Script-Function can also be written with trame/python, but that code would (for my understanding) always run on the server, while (I guess so) the JS-Code from the vue-Component would run on the client, does it?
Beta Was this translation helpful? Give feedback.
All reactions