组件介绍 - Component
上一篇
图形使用 - JSX
下一篇
多端适配
Loading...
组件结构基本保持和 React 一致,如果你了解 React ,相信你一看就会
import { Component } from '@antv/f2';class Hello extends Component {constructor(props) {super(props);}willMount() {}didMount() {}shouldUpdate() {return true;}willReceiveProps(props) {}willUpdate() {}didUpdate() {}render() {const { color } = this.props;return <rect attrs={{ x: 10, y: 10, width: 10, height: 10, fill: color }} />;}didUnmount() {}}
import { Canvas } from '@antv/f2';import Hello from './hello';<Canvas><Hello color="red" /></Canvas>;