Custom fieldtype label showing in CP, but not the component itself. #8518
-
I just upgraded a Statamic v3.4 website to v4.14 (fwiw) and am now trying to create a custom fieldtype. I have followed the instructions but have an issue where my custom fieldtype is displaying in the CP, but only the label. I have ensured that my Vue component has content to display. I can see in Chrome devtools that the component is hidden (it displays as Is there something obvious that I'm missing? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Are you running your addon's watcher ( |
Beta Was this translation helpful? Give feedback.
-
@duncanmcclean yep, and I can even run code in the mounted() hook:
|
Beta Was this translation helpful? Give feedback.
-
I tried a bunch of different things to no avail, but was finally able to get my component to show up by inlining in:
|
Beta Was this translation helpful? Give feedback.
-
I recently had the same problem in an older statamic project. The solution was to upgrade the project to vite and then separate the compiling vue2 for cp and vue3 for frontend, as the documentation suggests. In my case the inline templating was not resolving the issue. Link to the docs: https://statamic.dev/extending/control-panel#using-vite |
Beta Was this translation helpful? Give feedback.
I tried a bunch of different things to no avail, but was finally able to get my component to show up by inlining in: