|
@@ -90,6 +90,7 @@ onMounted(() => {
|
|
|
watch(
|
|
|
() => props.data,
|
|
|
(newData) => {
|
|
|
+ console.log('🚀🚀🚀 newData', newData)
|
|
|
const list = newData
|
|
|
if (list.length > 60) {
|
|
|
list.shift()
|
|
@@ -102,7 +103,7 @@ watch(
|
|
|
? [{ ...option.value.series[0], data: list }]
|
|
|
: [{ ...option.value.series, data: list }]
|
|
|
: [{ data: list }], // 更新折线数据
|
|
|
- title: [{}, { text: `BPM: ${newData[newData.length - 1]} 次/分钟` }, {}], // 更新实时BPM
|
|
|
+ title: [{}, { text: `BPM: ${list && list.length && list[list.length - 1]} 次/分钟` }, {}], // 更新实时BPM
|
|
|
},
|
|
|
{ notMerge: false }
|
|
|
)
|
|
@@ -111,7 +112,7 @@ watch(
|
|
|
)
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<style scoped lang="less">
|
|
|
.chart {
|
|
|
width: 100%;
|
|
|
height: 300px;
|