template

模版展开框的列表,示例图:


// 模版列表
class Template extends React.Component {
    state = {
        list: []
    };

    componentDidMount() {
        $.get('/api/getTemplate', res => {
            this.setState({
                list: res.data
            });
        });
    }

    render() {
        return (
            <ul>
                {
                    list.map(d => {
                        return <li key={d.id}>{d.name}</li>
                    })
                }
            </ul>
        );
    }
}

// 配置项
{
  ...,
  template: <Template />
}

results matching ""

    No results matching ""