st-comp 0.0.221 → 0.0.223
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/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +339 -332
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-d3e408b3.js → index-5bf92793.js} +377 -370
- package/lib/{python-34cb78d0.js → python-bb7c0b7e.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/components/KlineTips/index.vue +17 -1
- package/packages/KlineBasic/components/Tips/index.vue +5 -3
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
8
|
<script setup>
|
|
9
|
-
import { computed } from "vue";
|
|
9
|
+
import { computed, watch, ref } from "vue";
|
|
10
10
|
import Tips from "../Tips/index.vue";
|
|
11
11
|
import { stMath } from "st-func";
|
|
12
12
|
const { round, formatValue } = stMath;
|
|
@@ -23,6 +23,14 @@ const props = defineProps({
|
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
const close = ref(null);
|
|
27
|
+
|
|
28
|
+
watch(() => props.activeIndex, () => {
|
|
29
|
+
if (close.value === null) {
|
|
30
|
+
close.value = props.data.data[props.activeIndex][1]
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
26
34
|
const mainTips = computed(() => {
|
|
27
35
|
const { data, activeIndex } = props;
|
|
28
36
|
if (data.data && data.data[activeIndex]) {
|
|
@@ -43,6 +51,14 @@ const mainTips = computed(() => {
|
|
|
43
51
|
diffColor = "green";
|
|
44
52
|
}
|
|
45
53
|
result.push({ label: "涨跌", value: `${round(itemData[6])}%`, color: diffColor });
|
|
54
|
+
const mowPercent = ((close.value / itemData[1]) - 1) * 100
|
|
55
|
+
let nowPercentColor;
|
|
56
|
+
if (mowPercent > 0) {
|
|
57
|
+
nowPercentColor = "red";
|
|
58
|
+
} else if (mowPercent < 0) {
|
|
59
|
+
nowPercentColor = "green";
|
|
60
|
+
}
|
|
61
|
+
result.push({ label: "至今涨幅", value: `${round(mowPercent)}%`, color: nowPercentColor });
|
|
46
62
|
return result;
|
|
47
63
|
}
|
|
48
64
|
return [];
|
|
@@ -26,10 +26,12 @@
|
|
|
26
26
|
if (widthList.value.length === 0) {
|
|
27
27
|
nextTick(() => {
|
|
28
28
|
Array.from(tipsRef.value.children).forEach((item: any, index) => {
|
|
29
|
-
if (
|
|
30
|
-
widthList.value[index] = '
|
|
29
|
+
if (props.data?.[index]?.label === '涨跌') {
|
|
30
|
+
widthList.value[index] = '80px'
|
|
31
|
+
} else if(props.data?.[index]?.label === '至今涨跌') {
|
|
32
|
+
widthList.value[index] = '100px'
|
|
31
33
|
} else {
|
|
32
|
-
widthList.value[index] = `${item.offsetWidth +
|
|
34
|
+
widthList.value[index] = `${item.offsetWidth + 26}px`
|
|
33
35
|
}
|
|
34
36
|
})
|
|
35
37
|
})
|