💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
*The 'actionMixin' means the Action object mix up with external Action. The 'base' is required.* - What functions are available from the base of the maka engine? Function Name | Description | Example in Action | Example in View --- | -- | --- | --- getState | get value in the state by path | this.base.getState('data.input') | $base.getState('data.input') setState | set value in the state by path | this.base.setState({'data.input', 'hello'}) | $base.setState({'data.input', 'hello'}) gs | =getState | this.base.gs('data.input') | $base.gs('data.input') ss | =setState | this.base.ss({'data.input', 'hello'}) |$base.ss({'data.input', 'hello'}) - To mix in custom action classes ```javascript import { actionMixin, registerAction } from 'maka' class CustomAction { alert = () => { alert() } } registerAction('CustomAction', CustomAction) @actionMixin('base', 'CustomAction') class action { constructor(option) { Object.assign(this, option.mixins) } } const view = { component: 'div', onClick: '{{$CustomAction.alert}}' } ```