But that fails because the methods seem to have not been binded yet to this:
TypeError: this.parseHeadElements is not a function
at Proxy.created (index-BRXhQldV.js:246:5488)
at callWithErrorHandling (index-BRXhQldV.js:17:2136)
at callWithAsyncErrorHandling (index-BRXhQldV.js:17:2244)
at callWithAsyncErrorHandling (index-BRXhQldV.js:17:2400)
at callHook$1 (index-BRXhQldV.js:17:24414)
at applyOptions (index-BRXhQldV.js:17:23477)
at finishComponentSetup (index-BRXhQldV.js:17:74881)
at setupStatefulComponent (index-BRXhQldV.js:17:74013)
at setupComponent (index-BRXhQldV.js:17:73411)
at q (index-BRXhQldV.js:17:46071)
However Joe's dashboard methods seem to have been binded already to the proxy object:
Ah yes confusing indeed. Will need to explain it in more detail.
I have added my code snippet above to the core ui-template node code (at this location), not inside the ui-template config screen like the users do. Because I am trying to fix a reported issue in the ui-template node core code. I am not trying to add that code snippet inside the editor of the ui-template node config screen.
So my created() hook (in the core ui-template node code) is being called, and inside this hook I want to build the DOM subtree (as specified by the user in the config screen).
So the created() hook of the ui-template core code is called in my debugger, but the this does not contain the functions which I had added to the methods section. Hopefully that describes my problem a bit better.
Also, did you rebuild after modifying? I often have issues with source maps (yuk). Try modifying the vite.config.js to provide non minified, full source.
build: {
// Generate a source map in dev mode
// sourcemap: process.env.NODE_ENV === 'development',
minify: process.env.NODE_ENV === 'development' ? false : undefined,
outDir: '../dist',
emptyOutDir: true
},
and of course, run npm run build:dev or npm run dev for hot reload
@Steve-Mcl
Think I found it
Have not tested it yet, but I think that will be the root cause.
I have two times methods: defined in my vue file: one time for the existing methods and one time for my new methods. Don't think that Vue will like that...
Sorry for the noise!!!
@Steve-Mcl,
Is there a particular reason why your build config is not in the standard vite.config.js file? Because together with that npm run build:dev command that seems to be working very nice. Such commands would be a welcome addition to the dashboard contribution docs, for people like me (who don't work with Vue in their daily jobs). Thanks for sharing your tips!!! Very useful...
Only because I am in the middle of the wysiwyg stuff and I am not in a simple position to switch branch and propose it. You hit lucky (timing wise) as I only just yesterday got sick of source maps being out of step and looked for alternative (which is what i proposed to you).
If your env is in a better state than mine, feel free to propose a change.