feat(ui): 为所有菜单组件添加nut-config-provider包装
增加themeVars配置以统一控制菜单项最大高度为650rpx
Showing
6 changed files
with
40 additions
and
3 deletions
| ... | @@ -34,11 +34,13 @@ | ... | @@ -34,11 +34,13 @@ |
| 34 | </view> | 34 | </view> |
| 35 | 35 | ||
| 36 | <!-- Filter options --> | 36 | <!-- Filter options --> |
| 37 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 37 | <nut-menu> | 38 | <nut-menu> |
| 38 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 39 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 39 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 40 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 40 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 41 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 41 | </nut-menu> | 42 | </nut-menu> |
| 43 | + </nut-config-provider> | ||
| 42 | </view> | 44 | </view> |
| 43 | 45 | ||
| 44 | <!-- Search Results --> | 46 | <!-- Search Results --> |
| ... | @@ -138,6 +140,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; | ... | @@ -138,6 +140,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; |
| 138 | import { getVehicleListAPI } from '@/api/car'; | 140 | import { getVehicleListAPI } from '@/api/car'; |
| 139 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 141 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 140 | 142 | ||
| 143 | +const themeVars = { | ||
| 144 | + menuItemContentMaxHeight: '650rpx', | ||
| 145 | +} | ||
| 146 | + | ||
| 141 | // Props | 147 | // Props |
| 142 | const props = defineProps({ | 148 | const props = defineProps({ |
| 143 | visible: { | 149 | visible: { | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 11:40:08 | 4 | + * @LastEditTime: 2025-07-16 13:52:14 |
| 5 | * @FilePath: /jgdl/src/pages/goodCarList/index.vue | 5 | * @FilePath: /jgdl/src/pages/goodCarList/index.vue |
| 6 | * @Description: 特价好车页面 | 6 | * @Description: 特价好车页面 |
| 7 | --> | 7 | --> |
| ... | @@ -27,11 +27,13 @@ | ... | @@ -27,11 +27,13 @@ |
| 27 | </view> | 27 | </view> |
| 28 | 28 | ||
| 29 | <!-- Filter options --> | 29 | <!-- Filter options --> |
| 30 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 30 | <nut-menu> | 31 | <nut-menu> |
| 31 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 32 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 32 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 33 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 33 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 34 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 34 | </nut-menu> | 35 | </nut-menu> |
| 36 | + </nut-config-provider> | ||
| 35 | </nut-sticky> | 37 | </nut-sticky> |
| 36 | 38 | ||
| 37 | <!-- 特价好车列表 --> | 39 | <!-- 特价好车列表 --> |
| ... | @@ -143,6 +145,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; | ... | @@ -143,6 +145,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; |
| 143 | import { getRecommendVehicleAPI } from '@/api/car'; | 145 | import { getRecommendVehicleAPI } from '@/api/car'; |
| 144 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 146 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 145 | 147 | ||
| 148 | +const themeVars = { | ||
| 149 | + menuItemContentMaxHeight: '650rpx', | ||
| 150 | +} | ||
| 151 | + | ||
| 146 | // 响应式数据 | 152 | // 响应式数据 |
| 147 | const searchValue = ref('') | 153 | const searchValue = ref('') |
| 148 | /** | 154 | /** | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 11:44:44 | 4 | + * @LastEditTime: 2025-07-16 13:52:32 |
| 5 | * @FilePath: /jgdl/src/pages/newCarList/index.vue | 5 | * @FilePath: /jgdl/src/pages/newCarList/index.vue |
| 6 | * @Description: 最新上架页面 | 6 | * @Description: 最新上架页面 |
| 7 | --> | 7 | --> |
| ... | @@ -27,11 +27,13 @@ | ... | @@ -27,11 +27,13 @@ |
| 27 | </view> | 27 | </view> |
| 28 | 28 | ||
| 29 | <!-- Filter options --> | 29 | <!-- Filter options --> |
| 30 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 30 | <nut-menu> | 31 | <nut-menu> |
| 31 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 32 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 32 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 33 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 33 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 34 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 34 | </nut-menu> | 35 | </nut-menu> |
| 36 | + </nut-config-provider> | ||
| 35 | </nut-sticky> | 37 | </nut-sticky> |
| 36 | 38 | ||
| 37 | <!-- 最新上架车辆列表 --> | 39 | <!-- 最新上架车辆列表 --> |
| ... | @@ -129,6 +131,11 @@ import './index.less' | ... | @@ -129,6 +131,11 @@ import './index.less' |
| 129 | import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; | 131 | import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; |
| 130 | import { getVehicleListAPI } from '@/api/car'; | 132 | import { getVehicleListAPI } from '@/api/car'; |
| 131 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 133 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 134 | + | ||
| 135 | +const themeVars = { | ||
| 136 | + menuItemContentMaxHeight: '650rpx', | ||
| 137 | +} | ||
| 138 | + | ||
| 132 | // 响应式数据 | 139 | // 响应式数据 |
| 133 | const searchValue = ref('') | 140 | const searchValue = ref('') |
| 134 | /** | 141 | /** | ... | ... |
| ... | @@ -20,11 +20,13 @@ | ... | @@ -20,11 +20,13 @@ |
| 20 | </view> | 20 | </view> |
| 21 | 21 | ||
| 22 | <!-- Filter options --> | 22 | <!-- Filter options --> |
| 23 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 23 | <nut-menu> | 24 | <nut-menu> |
| 24 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 25 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 25 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 26 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 26 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 27 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 27 | </nut-menu> | 28 | </nut-menu> |
| 29 | + </nut-config-provider> | ||
| 28 | </nut-sticky> | 30 | </nut-sticky> |
| 29 | 31 | ||
| 30 | <!-- Scooter listings - 参考PostPage.tsx --> | 32 | <!-- Scooter listings - 参考PostPage.tsx --> |
| ... | @@ -119,6 +121,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; | ... | @@ -119,6 +121,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; |
| 119 | import { getVehicleListAPI } from '@/api/car'; | 121 | import { getVehicleListAPI } from '@/api/car'; |
| 120 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 122 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 121 | 123 | ||
| 124 | +const themeVars = { | ||
| 125 | + menuItemContentMaxHeight: '650rpx', | ||
| 126 | +} | ||
| 127 | + | ||
| 122 | // 响应式数据 | 128 | // 响应式数据 |
| 123 | const searchValue = ref('') | 129 | const searchValue = ref('') |
| 124 | /** | 130 | /** | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-09-19 14:11:06 | 2 | * @Date: 2022-09-19 14:11:06 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-07-16 11:45:18 | 4 | + * @LastEditTime: 2025-07-16 13:52:24 |
| 5 | * @FilePath: /jgdl/src/pages/recommendCarList/index.vue | 5 | * @FilePath: /jgdl/src/pages/recommendCarList/index.vue |
| 6 | * @Description: 精品推荐页面 | 6 | * @Description: 精品推荐页面 |
| 7 | --> | 7 | --> |
| ... | @@ -27,11 +27,13 @@ | ... | @@ -27,11 +27,13 @@ |
| 27 | </view> | 27 | </view> |
| 28 | 28 | ||
| 29 | <!-- Filter options --> | 29 | <!-- Filter options --> |
| 30 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 30 | <nut-menu> | 31 | <nut-menu> |
| 31 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 32 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 32 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 33 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 33 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 34 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 34 | </nut-menu> | 35 | </nut-menu> |
| 36 | + </nut-config-provider> | ||
| 35 | </nut-sticky> | 37 | </nut-sticky> |
| 36 | 38 | ||
| 37 | <!-- 精品推荐车辆列表 --> | 39 | <!-- 精品推荐车辆列表 --> |
| ... | @@ -138,6 +140,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; | ... | @@ -138,6 +140,10 @@ import { getVehicleBrandsAPI, getSchoolsAPI } from '@/api/other'; |
| 138 | import { getRecommendVehicleAPI } from '@/api/car'; | 140 | import { getRecommendVehicleAPI } from '@/api/car'; |
| 139 | import { DEFAULT_COVER_IMG } from '@/utils/config' | 141 | import { DEFAULT_COVER_IMG } from '@/utils/config' |
| 140 | 142 | ||
| 143 | +const themeVars = { | ||
| 144 | + menuItemContentMaxHeight: '650rpx', | ||
| 145 | +} | ||
| 146 | + | ||
| 141 | // 响应式数据 | 147 | // 响应式数据 |
| 142 | const searchValue = ref('') | 148 | const searchValue = ref('') |
| 143 | /** | 149 | /** | ... | ... |
| ... | @@ -27,11 +27,13 @@ | ... | @@ -27,11 +27,13 @@ |
| 27 | </view> | 27 | </view> |
| 28 | 28 | ||
| 29 | <!-- Filter options --> | 29 | <!-- Filter options --> |
| 30 | + <nut-config-provider :theme-vars="themeVars"> | ||
| 30 | <nut-menu> | 31 | <nut-menu> |
| 31 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> | 32 | <nut-menu-item v-model="selectedBrand" :options="brandOptions" @change="onBrandChange" /> |
| 32 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> | 33 | <nut-menu-item v-model="selectedYear" :options="yearOptions" @change="onYearChange" /> |
| 33 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> | 34 | <nut-menu-item v-model="selectedSchool" :options="schoolOptions" @change="onSchoolChange" /> |
| 34 | </nut-menu> | 35 | </nut-menu> |
| 36 | + </nut-config-provider> | ||
| 35 | </nut-sticky> | 37 | </nut-sticky> |
| 36 | 38 | ||
| 37 | <!-- Search Results --> | 39 | <!-- Search Results --> |
| ... | @@ -126,6 +128,10 @@ import { Search2, Check, Heart1, HeartFill } from '@nutui/icons-vue-taro' | ... | @@ -126,6 +128,10 @@ import { Search2, Check, Heart1, HeartFill } from '@nutui/icons-vue-taro' |
| 126 | import { useFavorite } from '@/composables/useFavorite' | 128 | import { useFavorite } from '@/composables/useFavorite' |
| 127 | import "./index.less"; | 129 | import "./index.less"; |
| 128 | 130 | ||
| 131 | +const themeVars = { | ||
| 132 | + menuItemContentMaxHeight: '650rpx', | ||
| 133 | +} | ||
| 134 | + | ||
| 129 | // 响应式数据 | 135 | // 响应式数据 |
| 130 | const searchValue = ref('') | 136 | const searchValue = ref('') |
| 131 | // 收藏功能现在使用基于对象属性的模式 | 137 | // 收藏功能现在使用基于对象属性的模式 | ... | ... |
-
Please register or login to post a comment