Closed Meplos closed 2 years ago
How ?
It is quite hidden in the doc but this example uses newFunction.
Please note that a new function is compiled, but the provided string is not a full function signature, only an expression that will injected after a return statement, see the source code here.
Thank you @albanm !
Yeah I see, this limits in some way having more javascript logic there... Is this choice by design ?
I think it didn't feel natural to inject multiple line statements, function definitions, etc. A simple string in a JSON file is not the good place to write large chunks of dynamic code. But you should be able to call more complex functions either from the global scope or referenced in options.context.
Hey! How to use newFunction expression in an x-if.