seleteSpeed = (e) => {
console.log('666', e.target.value);
console.log('777', e.target);
// debugger;
e.stopPropagation();
this.setState({
speed0: e.target.value === 0,
speed1: e.target.value === 1,
speed2: e.target.value === 2,
speed3: e.target.value === 3,
speed4: e.target.value === 4
});
this.setState({
text: e.target.value === 1 ? '1.0x' : e.target.innerHTML
});
const values = e.target.value === 0 ? 0.5 : e.target.value;
console.log('333', values);
window.BMapForVideoMap.setSpeed(values);
}
点击某个li元素,用e.target.value获取其value属性值,但是value=“0.5”时,e.target.value=0,所以倒数第三行加三元表达式判断达到目的,传出0.5给地图接收的API