修复html属性的bug!
This commit is contained in:
@@ -18,58 +18,59 @@ import { reactive, onMounted } from "vue";
|
||||
import * as echarts from "echarts";
|
||||
|
||||
export default {
|
||||
name: "ArchievementChartComponent",
|
||||
props: {
|
||||
chartData: {
|
||||
type: Array,
|
||||
require: true,
|
||||
default: () => [],
|
||||
name: "ArchievementChartComponent",
|
||||
props: {
|
||||
chartData: {
|
||||
type: Array,
|
||||
require: true,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
},
|
||||
setup (props)
|
||||
{
|
||||
const ui = reactive({
|
||||
chart_data: props.chartData,
|
||||
});
|
||||
|
||||
// 设置图表
|
||||
const initCharts = () =>
|
||||
setup( props )
|
||||
{
|
||||
const chartDom = document.getElementById("chartWrapper");
|
||||
const myChart = echarts.init(chartDom as HTMLDivElement);
|
||||
const option = {
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",],
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
data: [200, 400, 600, 800, 1000,],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: props.chartData,
|
||||
type: "line",
|
||||
},
|
||||
],
|
||||
};
|
||||
const ui = reactive( {
|
||||
} );
|
||||
|
||||
option && myChart.setOption(option);
|
||||
// 设置图表
|
||||
const initCharts = () =>
|
||||
{
|
||||
const chartDom = document.getElementById( "chartWrapper" );
|
||||
const myChart = echarts.init( chartDom as HTMLDivElement );
|
||||
const option = {
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二",],
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
data: [200, 400, 600, 800, 1000,],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: props.chartData,
|
||||
type: "line",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
window.onresize = function ()
|
||||
{
|
||||
// 自适应大小
|
||||
myChart.resize();
|
||||
};
|
||||
};
|
||||
option && myChart.setOption( option );
|
||||
|
||||
onMounted(() =>
|
||||
{
|
||||
initCharts();
|
||||
});
|
||||
window.onresize = function ()
|
||||
{
|
||||
// 自适应大小
|
||||
myChart.resize();
|
||||
};
|
||||
};
|
||||
|
||||
return { ui, initCharts, };
|
||||
},
|
||||
onMounted( () =>
|
||||
{
|
||||
initCharts();
|
||||
} );
|
||||
|
||||
console.log( props );
|
||||
|
||||
return { ui, initCharts, props, };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -4,8 +4,8 @@
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/components/HonorListComponent.vue
|
||||
* @Description: 光荣榜组件
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<div class="honorlist-wrapper">
|
||||
@@ -40,17 +40,17 @@ export default {
|
||||
month: {
|
||||
type: String,
|
||||
require: true,
|
||||
default:()=>"本",
|
||||
default: () => "本",
|
||||
},
|
||||
leadingReward: {
|
||||
type: String,
|
||||
require: true,
|
||||
default:()=>"",
|
||||
default: () => "",
|
||||
},
|
||||
advanceReward: {
|
||||
type: String,
|
||||
require: true,
|
||||
default:()=>"",
|
||||
default: () => "",
|
||||
},
|
||||
},
|
||||
setup()
|
||||
@@ -102,7 +102,6 @@ export default {
|
||||
width: 165px;
|
||||
height: 100%;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.advance-reward-wrapper {
|
||||
@@ -134,4 +133,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user