在uploadImage 函数参数中,'e' 的正确类型是什么?
public uploadImage(e /* :type of e */){
const image = e.target.files[0];
const reader = new FileReader();
reader.readAsDataURL(image);
reader.onload = e =>{
this.previewImage = e.target.result;
console.log(this.previewImage);
};
}
Run Code Online (Sandbox Code Playgroud)
在模板中我有这个
<input type="file" accept="image/jpeg" @change=uploadImage>
Run Code Online (Sandbox Code Playgroud) 如何对齐 Material UI 输入文本的文本?以下似乎不起作用。我使用的是 1.x 版
import {Input} from 'material-ui';
//didn't work
<Input
className="max-w-128 inline-block"
style = {{textAlign: 'center'}}
id="input-quantity"
inputStyle={{ textAlign: 'center' }}
//tried hintStyle as suggested in a bug
hintStyle={{ width: '600px', textAlign: 'center' }}
value={this.state.currentRecord.quantity}
onChange={this.handleCurrentRecordTextChange('quantity')}
/>
Run Code Online (Sandbox Code Playgroud)