st-comp 0.0.121 → 0.0.122
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/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +246 -224
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-dbad59c9.js → index-62c62885.js} +35 -13
- package/lib/{python-ab788b86.js → python-6cdad7a6.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineNew/components/KlineTips/index.vue +31 -3
package/package.json
CHANGED
|
@@ -17,6 +17,18 @@ const props = defineProps({
|
|
|
17
17
|
type: Object,
|
|
18
18
|
require: true,
|
|
19
19
|
},
|
|
20
|
+
// K线数据
|
|
21
|
+
// candlestickData: [开, 收, 低, 高, 成交额, 涨跌值, 涨跌百分比]
|
|
22
|
+
candlestickData: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => null,
|
|
25
|
+
},
|
|
26
|
+
// 主图指标数据
|
|
27
|
+
// mainIndicatorData: [key, data, color]
|
|
28
|
+
mainIndicatorData: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => null,
|
|
31
|
+
},
|
|
20
32
|
activeIndex: {
|
|
21
33
|
type: Number,
|
|
22
34
|
require: true,
|
|
@@ -24,9 +36,25 @@ const props = defineProps({
|
|
|
24
36
|
});
|
|
25
37
|
|
|
26
38
|
const mainTips = computed(() => {
|
|
27
|
-
const { drawData, activeIndex } = props as any;
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
const { drawData, activeIndex, candlestickData } = props as any;
|
|
40
|
+
if (candlestickData?.length && candlestickData[activeIndex]) {
|
|
41
|
+
// 新版传参 [开, 收, 低, 高, 成交额, 涨跌值, 涨跌百分比]
|
|
42
|
+
let diffColor;
|
|
43
|
+
if (candlestickData[activeIndex][6] > 0) {
|
|
44
|
+
diffColor = "red";
|
|
45
|
+
} else if (candlestickData[activeIndex][6] < 0) {
|
|
46
|
+
diffColor = "green";
|
|
47
|
+
}
|
|
48
|
+
return [
|
|
49
|
+
{ label: "开", value: round(candlestickData[activeIndex][0]) },
|
|
50
|
+
{ label: "高", value: round(candlestickData[activeIndex][3]) },
|
|
51
|
+
{ label: "低", value: round(candlestickData[activeIndex][2]) },
|
|
52
|
+
{ label: "收", value: round(candlestickData[activeIndex][1]) },
|
|
53
|
+
{ label: "额", value: formatValue(candlestickData[activeIndex][4]) },
|
|
54
|
+
{ label: "涨跌", value: `${round(candlestickData[activeIndex][6])}%`, color: diffColor }
|
|
55
|
+
]
|
|
56
|
+
} else if (drawData.candlestickData && drawData.candlestickData[activeIndex]) {
|
|
57
|
+
// candlestickData: [开, 收, 低, 高, 昨收, 交易总额]
|
|
30
58
|
const itemData = drawData.candlestickData[activeIndex];
|
|
31
59
|
const result = [
|
|
32
60
|
{ label: "开", value: round(itemData[0]) },
|