feat(web): add lint (#875)

* feat: add lint

* feat: fix lint error

* chore: add ignore file

* chore: close indent
This commit is contained in:
キリサメ qianxi
2022-07-10 15:45:55 +08:00
committed by GitHub
parent 475b6da35a
commit 503d244166
121 changed files with 17023 additions and 16815 deletions

View File

@ -14,48 +14,48 @@
import React from "react";
import * as Setting from "./Setting";
import { Select } from "antd";
import {Select} from "antd";
const { Option } = Select;
const {Option} = Select;
class SelectRegionBox extends React.Component {
constructor(props) {
super(props);
this.state = {
classes: props,
value: "",
};
}
onChange(e) {
this.props.onChange(e);
this.setState({value: e})
constructor(props) {
super(props);
this.state = {
classes: props,
value: "",
};
}
render() {
return (
<Select virtual={false}
showSearch
optionFilterProp="label"
style={{width: '100%'}}
defaultValue={this.props.defaultValue || undefined}
placeholder="Please select country/region"
onChange={(value => {this.onChange(value);})}
filterOption={(input, option) =>
option.label.indexOf(input) >= 0
}
>
{
Setting.CountryRegionData.map((item, index) => (
<Option key={index} value={item.code} label={item.code} >
<img src={`${Setting.StaticBaseUrl}/flag-icons/${item.code}.svg`} alt={item.name} height={20} style={{marginRight: 10}}/>
{`${item.name} (${item.code})`}
</Option>
))
}
</Select>
)
};
onChange(e) {
this.props.onChange(e);
this.setState({value: e});
}
render() {
return (
<Select virtual={false}
showSearch
optionFilterProp="label"
style={{width: "100%"}}
defaultValue={this.props.defaultValue || undefined}
placeholder="Please select country/region"
onChange={(value => {this.onChange(value);})}
filterOption={(input, option) =>
option.label.indexOf(input) >= 0
}
>
{
Setting.CountryRegionData.map((item, index) => (
<Option key={index} value={item.code} label={item.code} >
<img src={`${Setting.StaticBaseUrl}/flag-icons/${item.code}.svg`} alt={item.name} height={20} style={{marginRight: 10}} />
{`${item.name} (${item.code})`}
</Option>
))
}
</Select>
);
}
}
export default SelectRegionBox;