mirror of https://gitee.com/antv-l7/antv-l7
fix: tslint error
This commit is contained in:
parent
5b42f2d7b3
commit
5e442daa9e
|
@ -19,5 +19,6 @@ exports.onCreateWebpackConfig = ({ getConfig }) => {
|
||||||
'@antv/l7-scene': path.resolve(__dirname, 'packages/scene/src'),
|
'@antv/l7-scene': path.resolve(__dirname, 'packages/scene/src'),
|
||||||
'@antv/l7-source': path.resolve(__dirname, 'packages/source/src'),
|
'@antv/l7-source': path.resolve(__dirname, 'packages/source/src'),
|
||||||
'@antv/l7-utils': path.resolve(__dirname, 'packages/utils/src'),
|
'@antv/l7-utils': path.resolve(__dirname, 'packages/utils/src'),
|
||||||
|
'@antv/l7-react': path.resolve(__dirname, 'packages/react/src')
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,13 +9,10 @@ interface ILayerProps {
|
||||||
}
|
}
|
||||||
export default React.memo(function Chart(props: ILayerProps) {
|
export default React.memo(function Chart(props: ILayerProps) {
|
||||||
const { layer, scales } = props;
|
const { layer, scales } = props;
|
||||||
useEffect(
|
useEffect(() => {
|
||||||
() => {
|
|
||||||
scales.field
|
scales.field
|
||||||
? layer.scale(scales.field as string, scales.value as IScale)
|
? layer.scale(scales.field as string, scales.value as IScale)
|
||||||
: layer.scale(scales.values as IScaleOptions);
|
: layer.scale(scales.values as IScaleOptions);
|
||||||
},
|
}, [scales.value, scales.field, JSON.stringify(scales.values)]);
|
||||||
Object.values(scales).map((scale) => JSON.stringify(scales)),
|
|
||||||
);
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,8 +9,11 @@ interface ILayerProps {
|
||||||
}
|
}
|
||||||
export default React.memo(function Chart(props: ILayerProps) {
|
export default React.memo(function Chart(props: ILayerProps) {
|
||||||
const { layer, style } = props;
|
const { layer, style } = props;
|
||||||
useEffect(() => {
|
useEffect(
|
||||||
|
() => {
|
||||||
layer.style(style);
|
layer.style(style);
|
||||||
}, Object.values(style));
|
},
|
||||||
|
Object.keys(style).map((key) => style[key]),
|
||||||
|
);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"declarationDir": "./es",
|
"declarationDir": "./es",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"baseUrl": "./"
|
"baseUrl": "./",
|
||||||
|
"target": "es6",
|
||||||
},
|
},
|
||||||
"include": ["./src"]
|
"include": ["./src"]
|
||||||
}
|
}
|
Loading…
Reference in New Issue