编写前端请求代码

This commit is contained in:
2023-03-17 18:53:13 +08:00
parent 6f4dbdbd7e
commit 31d175d36a
10 changed files with 129 additions and 61 deletions

View File

@@ -26,16 +26,16 @@ export default {
default: () => [],
},
},
setup( props )
setup(props)
{
const ui = reactive( {
} );
const ui = reactive({
});
// 设置图表
const initCharts = () =>
{
const chartDom = document.getElementById( "chartWrapper" );
const myChart = echarts.init( chartDom as HTMLDivElement );
const chartDom = document.getElementById("chartWrapper");
const myChart = echarts.init(chartDom as HTMLDivElement);
const option = {
xAxis: {
type: "category",
@@ -53,7 +53,7 @@ export default {
],
};
option && myChart.setOption( option );
option && myChart.setOption(option);
window.onresize = function ()
{
@@ -62,12 +62,12 @@ export default {
};
};
onMounted( () =>
onMounted(() =>
{
initCharts();
} );
});
console.log( props );
console.log(props);
return { ui, initCharts, props, };
},