mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
fix metion styles
This commit is contained in:
parent
aa8e02326a
commit
57a34d8f5d
@ -40,11 +40,14 @@ const AsyncMention = React.createClass({
|
|||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { suggestions, loading } = this.state;
|
const { suggestions, loading } = this.state;
|
||||||
return (<Mention
|
return (
|
||||||
|
<Mention
|
||||||
|
style={{ width: 500, height: 100 }}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
suggestions={suggestions}
|
suggestions={suggestions}
|
||||||
onSearchChange={this.onSearchChange}
|
onSearchChange={this.onSearchChange}
|
||||||
/>);
|
/>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -50,11 +50,14 @@ const CustomNavMention = React.createClass({
|
|||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { suggestions, loading } = this.state;
|
const { suggestions, loading } = this.state;
|
||||||
return (<Mention
|
return (
|
||||||
|
<Mention
|
||||||
|
style={{ width: 500, height: 100 }}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
suggestions={suggestions}
|
suggestions={suggestions}
|
||||||
onSearchChange={this.onSearchChange}
|
onSearchChange={this.onSearchChange}
|
||||||
/>);
|
/>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,10 +21,10 @@ function onChange(editorState) {
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Mention
|
<Mention
|
||||||
|
style={{ width: 500, height: 100 }}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
defaultValue={toEditorState('@afc163')}
|
defaultValue={toEditorState('@afc163')}
|
||||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||||
/>,
|
/>
|
||||||
mountNode
|
, mountNode);
|
||||||
);
|
|
||||||
````
|
````
|
||||||
|
@ -55,7 +55,8 @@ let App = React.createClass({
|
|||||||
initialValue: this.state.initValue,
|
initialValue: this.state.initValue,
|
||||||
});
|
});
|
||||||
console.log('>> render', getFieldValue('mention') === this.state.initValue);
|
console.log('>> render', getFieldValue('mention') === this.state.initValue);
|
||||||
return (<Form horizontal form={this.props.form}>
|
return (
|
||||||
|
<Form horizontal form={this.props.form}>
|
||||||
<FormItem
|
<FormItem
|
||||||
id="control-mention"
|
id="control-mention"
|
||||||
label="最帅的码农"
|
label="最帅的码农"
|
||||||
@ -67,19 +68,17 @@ let App = React.createClass({
|
|||||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem wrapperCol={{ span: 12, offset: 7 }}>
|
<FormItem wrapperCol={{ span: 14, offset: 6 }}>
|
||||||
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
<Button type="primary" onClick={this.handleSubmit}>确定</Button>
|
||||||
|
|
||||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>);
|
</Form>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
App = Form.create()(App);
|
App = Form.create()(App);
|
||||||
ReactDOM.render(
|
|
||||||
<App />,
|
ReactDOM.render(<App />, mountNode);
|
||||||
mountNode
|
|
||||||
);
|
|
||||||
````
|
````
|
||||||
|
@ -37,22 +37,22 @@ const CustomNavMention = React.createClass({
|
|||||||
const filtered = webFrameworks.filter(item =>
|
const filtered = webFrameworks.filter(item =>
|
||||||
item.name.toLowerCase().indexOf(searchValue) !== -1
|
item.name.toLowerCase().indexOf(searchValue) !== -1
|
||||||
);
|
);
|
||||||
|
|
||||||
const suggestions = filtered.map(suggestion =>
|
const suggestions = filtered.map(suggestion =>
|
||||||
<Nav value={suggestion.name} >
|
<Nav value={suggestion.name} >
|
||||||
<span>{suggestion.name} - {suggestion.type} </span>
|
<span>{suggestion.name} - {suggestion.type} </span>
|
||||||
</Nav>);
|
</Nav>);
|
||||||
this.setState({
|
this.setState({ suggestions });
|
||||||
suggestions,
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { suggestions, loading } = this.state;
|
const { suggestions, loading } = this.state;
|
||||||
return (<Mention
|
return (
|
||||||
|
<Mention
|
||||||
|
style={{ width: 500, height: 100 }}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
suggestions={suggestions}
|
suggestions={suggestions}
|
||||||
onSearchChange={this.onSearchChange}
|
onSearchChange={this.onSearchChange}
|
||||||
/>);
|
/>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,11 +21,10 @@ function onChange(editorState) {
|
|||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Mention
|
<Mention
|
||||||
style={{ width: '100%', height: 200 }}
|
style={{ width: 500, height: 100 }}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
|
suggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
|
||||||
multiLines
|
multiLines
|
||||||
/>,
|
/>
|
||||||
mountNode
|
, mountNode);
|
||||||
);
|
|
||||||
````
|
````
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
&.active .ant-mention-editor {
|
&.active .ant-mention-editor {
|
||||||
.active;
|
.active;
|
||||||
}
|
}
|
||||||
.ant-mention-editor {
|
.ant-mention-editor {
|
||||||
.input;
|
.input;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
.ant-mention-editor-wrapper {
|
.ant-mention-editor-wrapper {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
Loading…
Reference in New Issue
Block a user