如何在“逐步转换”滑块中设置值

时间:2019-08-29 12:27:26

标签: javascript reactjs slider

我正在使用来自stackoverflow的this答案的阶梯状滑块。

REACT CODE

因此,滑块的值由“点”设置

import * as React from "react";
import ReactTable from "react-table";
import "react-table/react-table.css";

interface IProps {
  data: any;
  columns: any;
  rowClicked(): void;
}

interface IState {}

export default class DataGrid extends React.Component<IProps, IState> {
  onRowClick = (state: any, rowInfo: any, column: any, instance: any) => {
    this.props.rowClicked();
  };

  render() {
    return (
      <>
        <ReactTable
          data={this.props.data}
          columns={this.props.columns}
          getTdProps={this.onRowClick}
        />
      </>
    );
  }
}

并通过函数转换输出值

this.state = {
  sliderValue: 50
} 

问题是如何计算从sliderTransform(this.state.sliderValue) output的值(创建还原points函数)?

sliderTransform

0 个答案:

没有答案