mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-21 08:28:16 +00:00
feat: style setter 国际化
This commit is contained in:
parent
6ae17cf5f1
commit
4619ee3d57
@ -1,7 +1,10 @@
|
|||||||
|
import './style.less';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import LowStyleSetter from '@ali/lc-style-setter';
|
import LowStyleSetter from '@ali/lc-style-setter';
|
||||||
import './style.less';
|
import { createIntl } from '../../../globals';
|
||||||
|
|
||||||
|
const { getLocale } = createIntl();
|
||||||
|
|
||||||
export default class StyleSetter extends Component{
|
export default class StyleSetter extends Component{
|
||||||
|
|
||||||
@ -16,7 +19,7 @@ export default class StyleSetter extends Component{
|
|||||||
value: {},
|
value: {},
|
||||||
onChange: () => {},
|
onChange: () => {},
|
||||||
placeholder: '',
|
placeholder: '',
|
||||||
locale: 'zh-CN'
|
locale: getLocale() || 'en-US'
|
||||||
};
|
};
|
||||||
|
|
||||||
onChange = (val: any) => {
|
onChange = (val: any) => {
|
||||||
@ -25,11 +28,10 @@ export default class StyleSetter extends Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
console.log(this.props);
|
|
||||||
const { value } = this.props;
|
const { value } = this.props;
|
||||||
return (
|
return (
|
||||||
<div className="lc-block-setter">
|
<div className="lc-block-setter">
|
||||||
<LowStyleSetter value={value} onChange={this.onChange} />
|
<LowStyleSetter {...this.props} value={value} onChange={this.onChange} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user