小编has*_*ghe的帖子

Vue TypeScript 项目中事件的类型是什么?

在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)

typescript vue.js

11
推荐指数
3
解决办法
1万
查看次数

MaterialUI 如何将输入中的文本向右或居中对齐?

如何对齐 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)

css reactjs material-ui

3
推荐指数
2
解决办法
1万
查看次数

标签 统计

css ×1

material-ui ×1

reactjs ×1

typescript ×1

vue.js ×1