It’s my first time registering a function for use in Plasmic Studio,
and I’m not sure how to access it.
My goal is using this pinyin converter (website/repo) to convert dynamic value chinese characters to latin characters, something like “很好” → “hen hao”.
- I’ve installed the package as they suggested
npm install pinyin
- Here’s what I added in plasmic.init:
import pinyin from "pinyin";
PLASMIC.registerFunction(pinyin, {
name: 'pinyin'
});
- And then, I couldn’t figure out how to use it in Plasmic Studio
I assumed it would be something like$$.pinyin().$state.name.value