import type { Interfaces } from '@quickbi/bi-open-sdk'; import './component.scss'; class MyComponent { render(props: Interfaces.LifecycleProps) { const viewConfig = props.customProps!.viewConfig; props.container!.textContent = `I ${viewConfig?.fruit?.apple ? 'like' : "don't like"} apple, I want to eat ${ viewConfig?.fruit?.banana } banana`; } /** * trigger when component mounted */ mount(props: Interfaces.LifecycleProps) { props.container!.classList.add('test-component'); console.log('trigger when component mount', props); this.render(props); } /** * trigger when component updated */ update(props: Interfaces.LifecycleProps) { console.log('trigger when component update', props); this.render(props); } /** * trigger when component unmount */ unmount(props: Interfaces.LifecycleProps) { console.log('trigger when component unmount', props); } } export default MyComponent;