@visactor/taro-vchart 0.2.0-alpha.0 → 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/src/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IChartProps, VChartEnvType } from './typings';
|
|
2
2
|
interface IVChartProps extends IChartProps {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 配置环境。如果没有声明,则会通过 `Taro.getEnv()` 自动获取。
|
|
5
5
|
* - `tt` 字节小程序。
|
|
6
6
|
* - `lark` 飞书小程序。
|
|
7
7
|
* - `h5` 浏览器环境, 与`web`等价。
|
|
8
8
|
* - `web` 浏览器环境, 与`h5`等价。
|
|
9
9
|
*/
|
|
10
|
-
type
|
|
10
|
+
type?: VChartEnvType;
|
|
11
11
|
}
|
|
12
12
|
export default function VChart({ type, ...args }: IVChartProps): any;
|
|
13
13
|
export { VChart };
|
package/lib/src/index.js
CHANGED
|
@@ -131,9 +131,6 @@ class TTCanvas {
|
|
|
131
131
|
(_a = this.chartInstance) === null || _a === void 0 ? void 0 : _a.updateSpec(props.spec, true);
|
|
132
132
|
}
|
|
133
133
|
release() {
|
|
134
|
-
/**
|
|
135
|
-
* 修复各种内存泄漏问题
|
|
136
|
-
*/
|
|
137
134
|
if (!this.chartInstance)
|
|
138
135
|
return;
|
|
139
136
|
// 释放: 图表
|
|
@@ -291,7 +288,7 @@ class GeneralChart extends React.Component {
|
|
|
291
288
|
|
|
292
289
|
function VChart(_a) {
|
|
293
290
|
var { type } = _a, args = __rest(_a, ["type"]);
|
|
294
|
-
const env = type.toLocaleLowerCase();
|
|
291
|
+
const env = type ? type.toLocaleLowerCase() : Taro.getEnv();
|
|
295
292
|
const strategies = {
|
|
296
293
|
lark: () => {
|
|
297
294
|
return React.createElement(GeneralChart, Object.assign({}, args));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IInitOption } from '@visactor/vchart
|
|
1
|
+
import { IInitOption } from '@visactor/vchart';
|
|
2
2
|
export { IInitOption as IOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IVChart, ISpec } from '@visactor/vchart
|
|
1
|
+
import { IVChart, ISpec } from '@visactor/vchart';
|
|
2
2
|
export { IVChart, ISpec };
|