适配移动端展示

This commit is contained in:
fish
2026-05-04 21:36:48 +08:00
parent c852b1d871
commit b6bacbfae9
10 changed files with 298 additions and 106 deletions

View File

@@ -4,6 +4,9 @@ import { ElMessage } from 'element-plus'
import { listContracts } from '@/api/scores'
import { listCandles, type Candle } from '@/api/candles'
import KLineChart from '@/components/KLineChart.vue'
import { useMobile } from '@/composables/useMobile'
const { isMobile } = useMobile()
const filter = reactive<{ ts_code: string; range: [string, string] | [] }>({
ts_code: '',
@@ -40,13 +43,13 @@ onMounted(async () => {
<template>
<div class="page">
<el-card shadow="never" class="filter-card">
<el-form :inline="true">
<el-form :inline="!isMobile">
<el-form-item label="合约">
<el-select
v-model="filter.ts_code"
placeholder="选择合约"
filterable
style="width: 200px"
:style="{ width: isMobile ? '100%' : '200px' }"
>
<el-option v-for="c in contracts" :key="c" :label="c" :value="c" />
</el-select>
@@ -59,6 +62,7 @@ onMounted(async () => {
range-separator=""
start-placeholder=""
end-placeholder=""
:style="{ width: isMobile ? '100%' : 'auto' }"
/>
</el-form-item>
<el-form-item>