0.0.3 • Published 6 years ago

pps-p-location-selection v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

地点选择组件

调用方法

import React, { Component } from 'react'
import DefaultComponent from '../../src'
// 携程地点数据源, 线上通过接口获取
import dataSource from import dataSource from '../../src/components/defaultConfig/location';

export default class extends Component {
    state = {
        dataSource,
        show: true
    }

    /**
     * 选择地点函数
     * @param {string} data 地点选择回填数据
     */
    _selectLocation(data) {
        console.log(data);
    }

    /**
     * 关闭
     */
    _close = () => {
        this.setState({
            show: false
        })
    }

    render() {
        return (
            <div>
                {
                    this.state.show ? <DefaultComponent ref="location" {...this.state} selectLocation={this._selectLocation} close={this._close} /> : null
                }
            </div>
        )
    }
}
0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago