diff --git a/src/components/charts/G2/mixins/G2.js b/src/components/charts/G2/mixins/G2.js index ba8bf560..a171905d 100644 --- a/src/components/charts/G2/mixins/G2.js +++ b/src/components/charts/G2/mixins/G2.js @@ -2,34 +2,20 @@ import G2 from '@antv/g2' import * as DataSet from '@antv/data-set' -// Chart对象属性参数 初始化的时候使用 -import ChartProps from './_ChartProps' +// Chart对象属性参数 +import propsChart from './props/chart' +// 扩展属性 +import propsD2 from './props/d2' // 关闭 G2 的体验改进计划打点请求 G2.track(false) export default { props: { - // Chart对象属性参数 初始化的时候使用 - ...ChartProps, - // 图表数据 此 data 非 官方文档中的 data - data: { - type: Array, - required: false, - default: () => [] - }, - // 高度 开启自动填充父元素 (非G2自带) - autoHeight: { - type: Boolean, - required: false, - default: false - }, - // 在组件 mounted 后立即初始化图表 (非G2自带) - autoInit: { - type: Boolean, - required: false, - default: true - } + // Chart对象属性参数 + ...propsChart, + // 扩展属性 + ...propsD2 }, data () { return { diff --git a/src/components/charts/G2/mixins/_ChartProps.js b/src/components/charts/G2/mixins/props/chart.js similarity index 100% rename from src/components/charts/G2/mixins/_ChartProps.js rename to src/components/charts/G2/mixins/props/chart.js diff --git a/src/components/charts/G2/mixins/props/d2.js b/src/components/charts/G2/mixins/props/d2.js new file mode 100644 index 00000000..b63bf746 --- /dev/null +++ b/src/components/charts/G2/mixins/props/d2.js @@ -0,0 +1,20 @@ +export default { + // 图表数据 此 data 非 官方文档中的 data + data: { + type: Array, + required: false, + default: () => [] + }, + // 高度 开启自动填充父元素 (非G2自带) + autoHeight: { + type: Boolean, + required: false, + default: false + }, + // 在组件 mounted 后立即初始化图表 (非G2自带) + autoInit: { + type: Boolean, + required: false, + default: true + } +}