活动介绍

arco Desgin vue中<a-input 修改背景色

时间: 2024-09-09 20:13:15 浏览: 525
Arco Design 是一款基于 Ant Design 设计理念的 UI 设计语言和组件库,其中 `<a-input>` 是它提供的一个输入框组件。要修改 Arco Design Vue 中 `<a-input>` 组件的背景色,可以通过修改 CSS 样式来实现。以下是基本的步骤: 1. 找到需要修改背景色的 `<a-input>` 组件。 2. 通过自定义样式的方式,添加或覆盖默认样式。 3. 使用 CSS 选择器定位到该组件,并设置你希望的背景色。 示例代码如下: ```css /* 定位到 .arco-input 类,并设置背景色为浅灰色 */ .arco-input { background-color: #f5f5f5 !important; } ``` 请注意,这里使用了 `!important` 来确保样式可以覆盖掉组件默认的样式。如果组件类名有变化或者使用了其他类来定义样式,需要相应地调整 CSS 选择器。 另外,如果你使用的是组件的某个特定状态(如聚焦、禁用、错误等),可能需要更详细的选择器来准确地定位到那种状态下的背景色,比如 `.arco-input-disabled` 用于禁用状态的输入框。
相关问题

使用vue3 + arco design vue 实现以下功能 套餐名称:<a-input /> 姓名:<a-input /> 性别:<a-input /> 账号<a-input /> 一行展示4个 超出4个后换行

可以使用 flex 布局和 CSS 样式来实现一行展示 4 个,超过 4 个后自动换行的效果。具体实现可以参考以下代码: ```html <template> <div class="package-form"> <div class="form-row"> <label>套餐名称:</label> <a-input /> </div> <div class="form-row"> <label>姓名:</label> <a-input /> </div> <<div class="form-row"> <label>性别:</label> <a-input /> </div> <<div class="form-row"> <label>账号:</label> <a-input /> </div> </div> </template> <style> .package-form { display: flex; flex-wrap: wrap; } .form-row { flex-basis: 25%; margin-bottom: 10px; padding-right: 10px; } @media (max-width: 768px) { .form-row { flex-basis: 50%; } } </style> ``` 这里使用了 flex 布局和 media query,设置了在窗口宽度小于 768px 时,每行展示 2 个表单项。

<a-select v-model="formModel.floorId" placeholder="请选择层数" allow-clear> <a-option v-for="(v, i) in pliesAllList" :key="i" :value="v.value"> {{ v.label + 'F' }} </a-option> </a-select> arco.design中,自定义下拉框内容

<think>好的,用户的问题是关于在Arco Design中如何自定义a-select下拉框选项的内容和样式。首先,我需要回忆一下Arco Design的文档和相关组件用法。 记得在Arco Design中,a-select组件提供了多种自定义的方式。首先,用户可能想自定义下拉选项的内容,比如添加图标或者更复杂的结构。根据之前的经验,使用插槽(slot)应该是关键。可能需要用到option插槽或者label插槽来覆盖默认的选项渲染。 然后是样式的调整。Arco Design的组件通常允许通过类名或者内联样式来自定义,但下拉框作为弹出层,可能需要使用popupClassName属性来添加自定义的CSS类,从而覆盖默认样式。此外,如果遇到下拉框位置错位的问题,可能需要设置getPopupContainer属性,确保下拉框挂载到正确的父节点,避免滚动时错位,这和用户提供的引用[1]中的解决方案类似。 接下来,用户提到的点击icon没有反应的问题,引用[2]中提到是因为使用了suffixIcon插槽导致的事件处理问题。这可能提醒我在自定义图标时需要确保事件正确绑定,比如使用dropdownRender或者正确的事件修饰符。 需要分步骤解答:首先是如何自定义选项内容,使用option插槽;然后是如何修改样式,包括选项样式和下拉框整体样式;接着处理可能出现的定位问题,使用getPopupContainer;最后给出代码示例和注意事项,比如样式作用域和事件处理。 还要考虑用户可能遇到的问题,比如自定义内容后点击无效,或者样式不生效,需要提醒检查插槽使用是否正确,类名是否应用,以及弹出层的挂载点是否正确。 最后生成相关问题,覆盖组件其他常见问题,如搜索功能、多选模式、动态加载选项等,帮助用户进一步学习。</think>### 如何在 Arco Design 中自定义 a-select 下拉框内容 #### 1. 自定义选项内容 通过 `option` 插槽可完全控制选项的渲染内容。例如添加图标和复杂布局: ```vue <template> <a-select> <template #option="{ data }"> <div class="custom-option"> <icon-user /> <!-- 假设为组件库图标 --> <span>{{ data.label }}</span> <tag color="blue">{{ data.value }}</tag> </div> </template> </a-select> </template> ``` #### 2. 样式自定义 通过以下方式修改下拉框样式: ```vue <a-select :popup-class-name="'custom-dropdown'" :style="{ width: '300px' }" > <!-- 选项内容 --> </a-select> <style> /* 全局样式或使用 scoped */ .custom-dropdown .arco-select-option { padding: 12px; background: #f8f9fa; } .custom-dropdown .arco-select-option:hover { background: #e9ecef; } </style> ``` #### 3. 解决定位错位问题 滚动容器时添加挂载点配置(类似Ant Design方案): ```vue <a-select :get-popup-container="(triggerNode) => triggerNode.parentNode" > </a-select> ``` #### 4. 自定义后缀图标交互 若需要自定义触发图标,使用 `trigger` 插槽并手动控制状态: ```vue <template> <a-select v-model:popup-visible="visible"> <template #trigger> <div @click="visible = !visible"> <icon-custom :class="{ rotated: visible }"/> </div> </template> </a-select> </template> <script setup> import { ref } from 'vue'; const visible = ref(false); </script> ```
阅读全文

相关推荐

<template> 0" class="tabs-wrapper"> {{ section.name }} <a-empty description="暂无分类" /> <a-form :model="searchForm" label-align="left" auto-label-width layout="inline" :size="'large'" class="search-header" ref="searchHeaderRef"> <a-form-item style="width: 320px;" field="base_title" label="能力名称:" size="large"> <a-input allow-clear v-model="searchForm.base_title" placeholder="搜索能力..." @press-enter="fetchTableData" @clear="resetSearch"> <template #prefix> <icon-search /> </template> </a-input> </a-form-item> <a-form-item> <a-space size='large'> <a-button type="primary" size="medium" @click="fetchTableData"> <template #icon><icon-search /></template>查询 </a-button> <a-button type="outline" size="medium" @click="resetSearch"> <template #icon><icon-refresh /></template>重置 </a-button> </a-space> </a-form-item> </a-form> <a-spin :loading="loading" style="width: 100%"> 0" class="section-container" ref="sectionContainerRef" @scroll="handleScroll"> <icon-apps /> {{ section.name }} <template v-for="(subSection, subIndex) in section.children" :key="subIndex"> {{ subSection.name }} 能力背景 能力图标 <a-image width="100" height="100" src="some-error.png" /> {{ item.title }} {{ item.description }} </template> <a-empty description="暂无能力数据" /> </a-spin> </template> <script setup lang="ts"> import { ref, onMounted, nextTick, reactive } from 'vue'; import { IconSearch, IconApps, IconRefresh } from '@arco-design/web-vue/es/icon'; import { Message } from '@arco-design/web-vue'; import { useAbilityMallStore } from '@/store/modules/ability-mall'; import { storeToRefs } from 'pinia'; import { useRouter } from 'vue-router'; import { getAbilityMallList, getabilityMallDetails, createAbilityMall, } from '@/api/abilityMall'; const abilityMallStore = useAbilityMallStore(); const { abilityMallList, abilityMallDetails } = storeToRefs(abilityMallStore); const { getabilityMallDetailsStore } = abilityMallStore; const router = useRouter(); // 定义三级分类数据结构 interface CategoryItem { id: string; title: string; description: string; image: string; } interface SubCategory { id: string; name: string; children: CategoryItem[]; } interface MainCategory { id: string; name: string; children: SubCategory[]; } // 状态管理 const sections = ref<MainCategory[]>([]); const sectionContainerRef = ref<HTMLElement | null>(null); const searchHeaderRef = ref<HTMLElement | null>(null); // 添加搜索表单引用 const sectionRefs = ref<HTMLElement[]>([]); const activeIndex = ref(0); const loading = ref(false); const headerHeight = ref(0); const searchForm = reactive({ base_title: '', }); // 更高效的数据转换函数 const transformData = (apiData: any[]): MainCategory[] => { const categoryMap = new Map<string, MainCategory>(); const subcategoryMap = new Map<string, SubCategory>(); apiData.forEach((item) => { const categoryName = item.base_category; const categoryId = categoryName.replace(/\s+/g, '-').toLowerCase(); // 处理一级分类 if (!categoryMap.has(categoryId)) { categoryMap.set(categoryId, { id: categoryId, name: categoryName, children: [], }); } const category = categoryMap.get(categoryId)!; // 处理二级分类 const subcategoryName = item.base_subcategory; const subcategoryId = ${categoryId}-${subcategoryName .replace(/\s+/g, '-') .toLowerCase()}; if (!subcategoryMap.has(subcategoryId)) { const subcategory: SubCategory = { id: subcategoryId, name: subcategoryName, children: [], }; subcategoryMap.set(subcategoryId, subcategory); category.children.push(subcategory); } const subcategory = subcategoryMap.get(subcategoryId)!; // 添加三级分类项 subcategory.children.push({ id: item.id, title: item.base_title, description: item.base_content, image: item.base_image, // 添加图片字段 }); }); return Array.from(categoryMap.values()); }; // 设置章节引用 const setSectionRef = (el: any) => { if (el) { sectionRefs.value.push(el); } }; // 获取搜索表单高度 const getSearchHeaderHeight = (): number => { return searchHeaderRef.value?.offsetHeight || 80; }; // 滚动到指定章节 - 修复滚动位置计算 const scrollToSection = (index: number) => { if (!sectionContainerRef.value || index < 0 || index >= sectionRefs.value.length) return; activeIndex.value = index; const targetSection = sectionRefs.value[index]; const headerHeight = getSearchHeaderHeight(); // 精确计算滚动位置:目标位置 - 顶部间距 + 容器滚动位置 const targetOffset = targetSection.offsetTop - headerHeight; sectionContainerRef.value.scrollTo({ top: targetOffset, behavior: 'smooth', }); }; // 初始化滚动监听 const initScrollListener = () => { if (!sectionContainerRef.value) return; // 初始计算一次搜索表单高度 headerHeight.value = getSearchHeaderHeight(); }; // 处理滚动事件 - 修复滚动位置判断逻辑 const handleScroll = () => { if (!sectionContainerRef.value || sectionRefs.value.length === 0) return; const scrollTop = sectionContainerRef.value.scrollTop; const containerHeight = sectionContainerRef.value.clientHeight; const headerHeight = getSearchHeaderHeight(); // 计算有效滚动位置(考虑搜索表单高度) const effectiveScrollTop = scrollTop + headerHeight; // 1. 处理滚动到底部的情况 if (scrollTop + containerHeight >= sectionContainerRef.value.scrollHeight - 10) { activeIndex.value = sectionRefs.value.length - 1; return; } // 2. 精确计算当前激活的section let currentIndex = 0; let closestDistance = Number.MAX_VALUE; // 找到距离顶部最近的section for (let i = 0; i < sectionRefs.value.length; i++) { const section = sectionRefs.value[i]; const distance = Math.abs(section.offsetTop - effectiveScrollTop); if (distance < closestDistance) { closestDistance = distance; currentIndex = i; } } // 3. 处理最后两个section的特殊情况 if (sectionRefs.value.length > 1) { const lastSection = sectionRefs.value[sectionRefs.value.length - 1]; const secondLastSection = sectionRefs.value[sectionRefs.value.length - 2]; // 当滚动位置接近最后两个section时 if (effectiveScrollTop >= secondLastSection.offsetTop - 50) { // 如果已经滚动到最后一个section if (effectiveScrollTop >= lastSection.offsetTop - headerHeight) { currentIndex = sectionRefs.value.length - 1; } else { currentIndex = sectionRefs.value.length - 2; } } } // 只有当索引变化时才更新 if (activeIndex.value !== currentIndex) { activeIndex.value = currentIndex; } }; // 重置搜索 const resetSearch = () => { searchForm.base_title = ''; fetchTableData(); }; // 获取数据 async function fetchTableData() { loading.value = true; try { const { data } = await getAbilityMallList(searchForm); const fakeData = data.filter((item) => item.deleted === 0); sections.value = transformData(fakeData || []); // 重置引用 nextTick(() => { sectionRefs.value = []; // 初始化滚动监听 setTimeout(() => { initScrollListener(); handleScroll(); // 初始计算一次激活状态 // 添加初始滚动位置修正 if (sections.value.length > 0) { scrollToSection(0); } }, 100); }); } catch (error) { console.error('获取能力模型失败:', error); Message.error('获取能力模型失败'); } finally { loading.value = false; } } // 跳转详情 const sceneDetail = async (item: CategoryItem) => { loading.value = true; await getabilityMallDetailsStore(item.id); router.push({ name: 'AbilityDetails', query: { id: item.id }, }); loading.value = false; }; // 生命周期钩子 onMounted(() => { fetchTableData(); }); </script> <style scoped> .container { display: flex; height: 100vh; position: relative; padding: 0; background: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; } /* 左侧导航栏样式 */ .tabs { width: 200px; padding: 20px 0; flex-shrink: 0; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; z-index: 10; background: #f9fafb; border-right: 1px solid #e5e6eb; .tabs-wrapper { padding: 0 10px; } .tab { height: 44px; line-height: 44px; text-align: center; margin: 8px 0; font-size: 15px; color: #1d2129; cursor: pointer; position: relative; transition: all 0.3s ease; border-radius: 6px; overflow: hidden; font-weight: 500; &:hover { background: #f2f3f5; color: #3261CE; transform: translateX(3px); } } .tab.active { color: #3261CE; background: #e8f3ff; font-weight: 600; box-shadow: 0 1px 4px rgba(22, 93, 255, 0.15); &::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 3px; background: #3261CE; } } .empty-container { padding: 40px 20px; } } /* 右侧内容区域 */ .content { flex: 1; height: 100%; position: relative; padding: 0; overflow: hidden; display: flex; flex-direction: column; } /* 搜索头部样式 */ .search-header { width: 100%; display: flex; gap: 16px; padding: 15px 24px; background: #fff; border-bottom: 1px solid #e5e6eb; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); position: sticky; top: 0; z-index: 20; .header-title { font-size: 20px; font-weight: 600; margin-right: 20px; color: #1d2129; } } /* 分类区域样式 - 关键修改 */ .section-container { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 0 24px; position: relative; height: calc(100vh - 80px); /* 减去搜索栏高度 */ } .section { padding: 32px 0; border-bottom: 1px solid #e5e6eb; &:first-child { padding-top: 24px; } &:last-child { border-bottom: none; } } .section-title { font-size: 22px; color: #1d2129; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #e5e6eb; font-weight: 600; display: flex; align-items: center; .arco-icon { margin-right: 10px; color: #3261CE; font-size: 20px; } } .title { font-size: 18px; color: #3261CE; margin: 24px 0 16px; padding-left: 12px; border-left: 4px solid #3261CE; font-weight: 500; } /* 内容项网格布局 */ .sub-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-top: 8px; } /* 内容项样式 */ .content-item { position: relative; height: 95px; cursor: pointer; border-radius: 8px; overflow: hidden; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); background: #fff; border: 1px solid #e5e6eb; /* 背景图片容器 */ .img-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transform: scale(1.05); transition: all 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); img { width: 100%; height: 100%; object-fit: cover; filter: blur(0); transition: filter 0.5s ease; } } /* 悬停效果 */ &:hover { transform: translateY(-5px); box-shadow: 0 12px 25px rgba(22, 93, 255, 0.2); border-color: rgba(22, 93, 255, 0.3); .img-wrapper { opacity: 1; transform: scale(1); img { filter: blur(4px) brightness(0.9); } } .item { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(4px); } .item-image img { transform: scale(1.8); } } } /* 内容卡片样式 */ .item { display: flex; position: relative; overflow: hidden; border-radius: 8px; width: 100%; height: 100%; z-index: 2; background: rgba(255, 255, 255, 0.95); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); } /* 图片样式 */ .item-image { width: 100px; height: 100%; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f7f8fa; transition: background 0.3s ease; img { width: 60px; height: 60px; object-fit: contain; display: block; transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); } .image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #c9cdd4; .arco-icon { font-size: 32px; } } } /* 文本区域样式 */ .item-text { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; } .item-title { font-size: 16px; color: #1d2129; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s ease; } .item-desc { font-size: 13px; color: #86909c; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; transition: color 0.3s ease; } /* 响应式调整 */ @media (max-width: 992px) { .container { flex-direction: column; } .tabs { width: 100%; position: sticky; top: 0; z-index: 30; display: flex; overflow-x: auto; padding: 10px 0; height: auto; border-right: none; border-bottom: 1px solid #e5e6eb; .tabs-wrapper { display: flex; padding: 0 16px; } .tab { flex-shrink: 0; margin: 0 8px; padding: 0 16px; height: 36px; line-height: 36px; } } .content { margin-left: 0; } .search-header { padding: 12px 16px; flex-wrap: wrap; } .section-container { padding: 0 16px; height: calc(100vh - 140px); /* 调整移动端高度 */ } .section { padding: 24px 0; } } @media (max-width: 576px) { .sub-content { grid-template-columns: 1fr; } .header-title { display: none; } .search-header { :deep(.arco-form-item) { width: 100%; margin-bottom: 12px; } } .section-container { height: calc(100vh - 180px); /* 调整小屏幕高度 */ } .content-item { height: 110px; } .item-image { width: 80px; } } </style>在这个代码基础上修改

<template> 0" class="tabs-wrapper"> {{ section.name }} <a-empty /> <a-form ref="searchHeaderRef" :model="searchForm" label-align="left" auto-label-width layout="inline" :size="'large'" class="search-header" > <a-form-item field="base_title" label="能力名称:" size="large" style="width: 420px" > <a-input allow-clear v-model="searchForm.base_title" placeholder="请输入能力名称..." @press-enter="fetchTableData" @clear="resetSearch" /> </a-form-item> <a-form-item field="" label=""> <a-space size="medium"> <a-button type="primary" size="medium" @click="fetchTableData" >查询</a-button > <a-button type="primary" size="medium" @click="resetSearch" >刷新</a-button > </a-space> </a-form-item> </a-form> <a-spin :loading="loading" style="width: 100%"> 0"> {{ section.name }} <template v-for="(subSection, subIndex) in section.children" :key="subIndex" > {{ subSection.name }} 背景图片 内容图片 <icon-image /> {{ item.title }} {{ item.description }} </template> <a-empty /> </a-spin> </template> <script setup lang="ts"> import { ref, onMounted, nextTick, reactive, onBeforeUnmount } from 'vue'; import { Message } from '@arco-design/web-vue'; import { IconImage } from '@arco-design/web-vue/es/icon'; import { useAbilityMallStore } from '@/store/modules/ability-mall'; import { storeToRefs } from 'pinia'; import { useRouter } from 'vue-router'; import { getAbilityMallList, getabilityMallDetails, createAbilityMall, } from '@/api/abilityMall'; const abilityMallStore = useAbilityMallStore(); const { abilityMallList, abilityMallDetails } = storeToRefs(abilityMallStore); const { getabilityMallDetailsStore } = abilityMallStore; const router = useRouter(); // 定义三级分类数据结构 interface CategoryItem { id: string; title: string; description: string; image: string; // 添加图片字段 } interface SubCategory { id: string; name: string; children: CategoryItem[]; } interface MainCategory { id: string; name: string; children: SubCategory[]; } // 状态管理 const sections = ref<MainCategory[]>([]); const contentRef = ref<HTMLElement | null>(null); const sectionRefs = ref<HTMLElement[]>([]); const activeIndex = ref(0); const loading = ref(false); const searchForm = reactive({ base_title: '', current: '', pageSize: '', }); // 创建 IntersectionObserver 实例 let observer = ref(null) // 更高效的数据转换函数 - 修复图片字段 const transformData = (apiData: any[]): MainCategory[] => { const categoryMap = new Map<string, MainCategory>(); const subcategoryMap = new Map<string, SubCategory>(); apiData.forEach((item) => { const categoryName = item.base_category; const categoryId = categoryName.replace(/\s+/g, '-').toLowerCase(); // 处理一级分类 if (!categoryMap.has(categoryId)) { categoryMap.set(categoryId, { id: categoryId, name: categoryName, children: [], }); } const category = categoryMap.get(categoryId)!; // 处理二级分类 const subcategoryName = item.base_subcategory; const subcategoryId = ${categoryId}-${subcategoryName .replace(/\s+/g, '-') .toLowerCase()}; if (!subcategoryMap.has(subcategoryId)) { const subcategory: SubCategory = { id: subcategoryId, name: subcategoryName, children: [], }; subcategoryMap.set(subcategoryId, subcategory); category.children.push(subcategory); } const subcategory = subcategoryMap.get(subcategoryId)!; // 添加三级分类项 - 包含图片字段 subcategory.children.push({ id: item.id, title: item.base_title, description: item.base_content, image: item.base_image, // 添加图片字段 }); }); return Array.from(categoryMap.values()); }; // 设置章节引用 const setSectionRef = (el: any) => { if (el) { sectionRefs.value.push(el); } }; // 左侧 Tab 点击跳转 const scrollToSection = (index) => { activeIndex.value = index; const section = sectionRefs.value[index]; if (section) { section.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }; // 初始化观察者 const initObserver = () => { observer.value = new IntersectionObserver( (entries) => { entries.forEach((entry) => { const index = sectionRefs.value.indexOf(entry.target); if (entry.isIntersecting) { activeIndex.value = index; } }); }, { threshold: 0.5, // 当目标元素 50% 可见时触发 rootMargin: "0px 0px -100% 0px", // 提前触发,防止底部卡住 } ); // 开始观察所有章节 sectionRefs.value.forEach((section) => { if (section) observer.observe(section); }); }; // 销毁观察者 const destroyObserver = () => { if (observer) { observer.value.disconnect(); } }; onMounted(() => { fetchTableData(); initObserver(); }); onBeforeUnmount(() => { destroyObserver(); }); // 重置搜索 const resetSearch = () => { searchForm.base_title = ''; fetchTableData(); }; // 获取数据 async function fetchTableData() { loading.value = true; try { const { data } = await getAbilityMallList(searchForm); const filteredData = data.filter((item) => item.deleted === 0); // const fakeData = Array.from({ length: 100 }, (_, index) => ({ // id: item-${index}, // base_category: 一级分类 ${Math.floor(Math.random() * 20)}, // base_subcategory: 二级分类 ${Math.floor(Math.random() * 10)}, // base_title: 能力名称 ${index + 1}, // base_content: 描述内容 ${index + 1}, // base_image: https://via.placeholder.com/100?text=Image${index + 1}, // deleted: Math.random() > 0.2 ? 0 : 1, // 80% chance of being valid // })); // 使用模拟数据 sections.value = transformData(filteredData || []); // 重置引用 nextTick(() => { sectionRefs.value = []; // 添加初始滚动位置修正 setTimeout(() => { const hash = window.location.hash.substring(1); if (hash) { const index = sections.value.findIndex((s) => s.id === hash); if (index !== -1) { scrollToSection(index); } } else if (sections.value.length > 0) { scrollToSection(0); } }, 100); }); } catch (error) { console.error('获取能力模型失败:', error); Message.error('获取能力模型失败'); loading.value = false; } finally { loading.value = false; } } // 跳转详情 const sceneDetail = async (item: CategoryItem) => { await getabilityMallDetailsStore(item.id); router.push({ path: '/ability/details', query: { id: item.id }, }); }; </script> <style scoped lang="less"> /* 父容器 */ .container { display: flex; height: 100vh; /* 让父容器撑满页面 */ position: relative; padding-left: 40px; background: #fff; font-family: 'DingTalkJinBuTi', serif; } /* 左侧导航栏样式 */ .tabs { width: 180px; padding: 20px 0; flex-shrink: 0; position: sticky; /* 使用粘性定位 */ top: 0; /* 固定在页面顶部 70px 位置 */ max-height: calc(100vh - 70px); /* 最大高度为视口高度,避免溢出 */ overflow-y: auto; /* 允许左侧滚动条 */ z-index: 10; .tab { height: 40px; line-height: 40px; letter-spacing: 1px; text-align: center; margin: 20px; margin-bottom: 12px; font-size: 16px; color: #181818; cursor: pointer; position: relative; transition: all 0.3s ease-in-out; border-radius: 4px; &:hover { background: linear-gradient(90deg, #3261ce 0%, #739ce2 100%); color: #fff; opacity: 0.9; transform: translateX(5px); } } .tab.active { color: #fff; background: linear-gradient(90deg, #3261ce 0%, #739ce2 100%); opacity: 1; box-shadow: 0 2px 8px rgba(50, 97, 206, 0.4); } } .tab-wrapper { overflow: auto; height: 100%; } /* 右侧内容区域 */ .content { flex: 1; height: 100%; overflow-y: auto; /* 允许右侧内容滚动 */ position: relative; scroll-behavior: smooth; margin-left: 20px; /* 右侧内容区域距离左侧导航栏 */ padding-top: 20px; padding-left: 20px; border-left: 1px solid rgba(0, 0, 0, 0.05); } /* 搜索头部样式 */ .content .search-header { width: 100%; display: flex; gap: 16px; padding: 15px 20px; background: #fff; border-bottom: 1px solid rgba(0, 0, 0, 0.05); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); ::v-deep(.arco-form-item) { margin-bottom: 0; } ::v-deep(.arco-form-item-label) { color: #4e5965; } } /* 分类区域样式 */ .section { height: auto; padding: 20px 20px 20px 0; position: relative; border-bottom: 1px solid rgba(0, 0, 0, 0.05); margin-top: 20px; &:first-child { margin-top: 0; } } .section .section-title { border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-size: 22px; color: #181818; height: 50px; display: flex; align-items: center; padding-bottom: 10px; margin-bottom: 20px; } .section .title { font-size: 18px; color: #3261ce; margin: 24px 0 12px; padding-left: 10px; border-left: 4px solid #3261ce; } /* 内容项网格布局 */ .section .sub-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(242px, 1fr)); gap: 20px; margin-top: 20px; position: relative; } /* 内容项样式 */ .section .sub-content .content-item { position: relative; height: 73px; cursor: pointer; // transition: all 0.3s ease; border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); &:hover { // transform: translateY(-5px); box-shadow: 0 8px 16px rgba(50, 97, 206, 0.2); border-color: rgba(50, 97, 206, 0.3); .position-img { opacity: 1; } .item { backdrop-filter: blur(5px); // background-color: hsla(0, 0%, 100%, 0.85); } .item-desc { opacity: 0.9; } .item-image img { transform: scale(1.35); } } } /* 内容卡片样式 */ .section .sub-content .content-item .item { display: flex; position: relative; overflow: hidden; border-radius: 6px; width: 100%; height: 100%; z-index: 2; // transition: all 0.3s ease; } /* 图片样式 */ .section .sub-content .content-item .item-image { width: 70px; height: 100%; flex-shrink: 0; overflow: hidden; padding: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; .image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #f5f7fa; color: #c9cdd4; svg { font-size: 24px; } } img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; } } /* 文本区域样式 */ .section .sub-content .content-item .item-text { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; .item-title { font-size: 14px; color: #171717cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .item-desc { font-size: 12px; color: #181818; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; // transition: opacity 0.3s ease; } } /* 背景图片 */ .position-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; overflow: hidden; // transition: opacity 0.3s ease-in-out; z-index: 1; img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(0.9); } } /* 占位空间 */ .spacer { height: 100px; } /* 响应式调整 */ @media (max-width: 992px) { .container { flex-direction: column; padding: 0 16px; } .tabs { position: static; width: 100%; margin-right: 0; max-height: none; display: flex; overflow-x: auto; padding: 10px 0; .tab { flex-shrink: 0; margin: 0 10px; } } .content { margin-left: 0; padding-top: 10px; } } </style> 右侧滚动条滚动的时候左侧tab 被选中

大家在看

recommend-type

IFIX 4.5 MB1 驱动

 MB1:有两个版本,6.x 和 7.x 版,通过串行口连接所有支持 Modbus 串行通讯协议的设备。主要有 Modicon PLC 和其它控制仪表如:Honeywell UDC,UMC,Moore 的控制仪表等。支持 Mobus RTU 和 ASCII 两种通讯协议。当使用其与其它兼容设备通讯时,注意数据类型会与 Modicon 的数据类型有所差别。7.x 版本支持电话拨号连接和无线电连接。
recommend-type

TLSF-All.rar_网络编程_C/C++_

TLSF2.46源代码+相关的英文文献在网站http://rtportal.upv.es/rtmalloc/上可以下载到原代码,但注意下载文件的格式。
recommend-type

思源黑体、简体、中文全套TTF格式

思源黑体、简体、中文全套TTF格式
recommend-type

高频感应加热电源斩波器补偿电路的设计

本文在分析基于功率控制的Buck斩波器的小信号模型和反馈控制模式的基础上,探讨了反馈控制的传递函数和环路参数的设计。对于高频感应加热电源广泛应用的Buck斩波调功电路,设计了双极点、双零点补偿电路,补偿后的系统不仅提高了系统响应速度,而且消除了稳态误差,系统性能明显提高。实验结果证明了这种补偿电路的实用性和有效性,对高频感应加热电源的改进和研究具有很好的参考价值。
recommend-type

XposedDetector

Xposed探测器 预制的静态库,用于检测xposed和清除钩子。 该库基于。 一体化 Gradle: implementation ' io.github.vvb2060.ndk:xposeddetector:2.2 ' 该库是 ,因此您需要在项目中启用它(Android Gradle Plugin 4.1+): android { .. . buildFeatures { .. . prefab true } } 用法 ndk构建 您可以在Android.mk使用xposed_detector 。 例如,如果您的应用程序定义了libapp.so并使用xposed_detector ,则您的Android.mk文件应包括以下内容: include $( CLEAR_VARS ) LOCAL_MODULE

最新推荐

recommend-type

【电子设计竞赛】2018年电子设计大赛A题失真度分析仪:从理论到代码实现全解析

内容概要:本文深入解析了2018年电子设计大赛A题——失真度分析仪的设计与实现。文章首先介绍了题目的背景与要求,包括谐波计算、数据显示和无线传输三个核心任务。接着详细阐述了解题思路,涵盖信号采集(ADC)、FFT分析、失真度计算、显示与无线传输等方面的技术要点。硬件设计部分重点讲解了信号调理电路、ADC电路、显示电路和无线传输电路的具体实现方法。最后提供了软件代码实现,包括ADC采样、FFT计算、失真度计算、数据显示与无线传输的代码示例。; 适合人群:对电子设计感兴趣的初学者、电子工程专业的学生及有一定基础的电子爱好者。; 使用场景及目标:①帮助读者理解失真度分析仪的工作原理和技术实现;②为准备参加类似电子设计竞赛的人提供参考;③通过实例代码加深对电子电路、信号处理和编程的理解。; 其他说明:本文不仅涵盖了理论知识,还提供了详细的代码实现,有助于读者在实践中学习和掌握相关技能。同时,文中提到的一些优化方向也为进一步探索电子设计提供了思路。
recommend-type

Python打造的Slaee管理系统升级版发布

由于提供的文件信息中,文件名《基于python的slaee管理系统 (15).zip》与描述《基于python的slaee管理系统 (15).zip》相同,并且给出的压缩包文件名称列表中只有一个文件《基于python的slaee管理系统 (14).zip》,该信息表明我们正在讨论两个不同版本的Python系统管理软件的压缩包。以下知识点将根据这些信息详细展开: 知识点一:Python编程语言基础 Python是一种高级编程语言,以其简洁的语法和强大的库支持而闻名。它是解释型语言,具有动态类型系统和垃圾回收功能,适用于多种编程范式,包括面向对象、命令式、函数式和过程式编程。Python广泛应用于系统管理、网络服务器、开发脚本、科学计算、数据挖掘和人工智能等领域。 知识点二:系统管理相关知识 系统管理指的是对计算机系统进行配置、监控和维护的过程,包括硬件资源、软件资源和数据资源的管理。在Python中,系统管理通常涉及操作系统级别的任务,如进程管理、文件系统管理、网络配置、系统日志监控等。Python的系统管理库(例如psutil、fabric、paramiko等)提供了丰富的API来简化这些任务。 知识点三:项目版本控制 从文件名《基于python的slaee管理系统 (14).zip》和《基于python的slaee管理系统 (15).zip》可以看出,这是一个项目在不同版本之间的迭代。版本控制是一种记录一个或多个文件随时间变化的方式,它允许用户可以回到特定版本。在软件开发中,版本控制非常重要,它有助于团队协作、代码合并、分支管理和错误跟踪。常见的版本控制系统包括Git、Subversion (SVN)、Mercurial等。 知识点四:打包与部署 提到“压缩包子文件”,这通常意味着文件已经被压缩打包成一个ZIP文件。在软件开发中,打包是为了便于文件传输、存档保存和分发。在Python项目中,打包也是部署过程的一部分。一个Python项目通常需要包含源代码、依赖关系、配置文件和安装脚本等。打包成ZIP文件后,可以通过各种方式部署到服务器上运行,如使用Fabric或Ansible等自动化部署工具。 知识点五:项目命名及版本命名规则 文件命名中的“基于python的slaee管理系统”表明这是一个与Python语言相关的系统管理项目。而数字“15”和“14”则代表着项目的版本号,这表明项目在持续发展,不同的数字代表了项目在不同时期的迭代。版本号的命名规则通常遵循语义化版本控制(SemVer),这种版本控制系统以 MAJOR.MINOR.PATCH 的形式表示版本号。 知识点六:文件压缩与解压缩技术 ZIP是一种常用的文件压缩格式,它通过减少文件大小来提高存储效率和传输速度。ZIP文件通常是无损压缩,意味着文件在压缩和解压缩的过程中不会丢失信息。Python标准库提供了zipfile模块,允许用户在Python程序中创建ZIP文件、读取ZIP文件内容、提取ZIP文件中的文件等操作。用户可以使用各种图形界面工具(如WinRAR、7-Zip)或命令行工具来处理ZIP文件。 总结以上内容,从文件信息中我们可以得知该内容涉及了Python编程语言、系统管理知识、版本控制、打包与部署、命名规则以及文件压缩技术等多方面的知识点。这些知识点对于理解和应用Python进行系统管理软件开发以及软件的版本迭代、打包与部署均具有重要意义。
recommend-type

深入解析PCB走线传输延时:关键因素与实用公式

# 1. PCB走线传输延时基础 在电子工程领域,尤其是在印刷电路板(PCB)设计中,走线传输延时是一个不可忽视的重要概念。传输延时主要指的是电信号通过PCB上的导电路径从源头传送到目的地所耗费的时间。本章将介绍PCB走线传输延时的基础知识点,为后续章节的深入探讨打下坚实的基础。 首先,了解什么是传输延时是至关重要的。简单来说,它反
recommend-type

gpio很弱是什么意思

<think>嗯,用户的问题是关于GPIO信号弱的概念及其影响。用户似乎对硬件或嵌入式系统有一定了解,但需要更深入的解释。从用户提到的"信号弱"来看,ta可能遇到了实际电路设计中的驱动能力问题,或者在学习GPIO原理时遇到了术语困惑。 用户引用了四篇资料,其中提到GPIO的模拟输入输出模式、施密特触发器的作用、上拉下拉电阻的配置,以及信号线串联电阻的作用。这些内容都与GPIO的驱动能力和信号质量相关。特别是引用[4]中提到的"信号线串联小电阻"和"低频电路不考虑反射",暗示用户可能正在处理实际电路中的信号完整性问题。 用户真正想知道的可能是:为什么我的GPIO输出无法正确驱动某个设备?或者
recommend-type

Python打造的Slaee管理系统升级版发布

标题中的“基于python的slaee管理系统”表明这是一个使用Python编程语言开发的系统。Python是一种广泛使用的高级编程语言,以其易读性和简洁的语法而闻名。SLAEE管理系统可能是指一个特定类型的管理软件,但由于没有给出缩写的完整解释,我们可以假设SLAEE可能是某机构或系统名称的缩写。 从标题和描述来看,存在一处笔误:“基于python的slaee管理系统 (19).zip”和“基于python的slaee管理系统 (18).zip”所指的似乎是同一软件系统,只是版本号不同。根据文件名称列表中的两个文件名,可以推断系统至少有两个版本,一个是版本18,一个是版本19。通常情况下,版本号的增加表示软件进行了更新或改进。 接下来,根据这些信息,我们可以阐述一些相关的知识点: 1. Python编程基础:Python是一种解释型、面向对象、高级编程语言。Python支持多种编程范式,包括过程式、面向对象和函数式编程。Python由于其简洁和易于学习的特性,被广泛应用于网络开发、数据分析、人工智能、机器学习和科学计算等领域。 2. 文件压缩与打包:文件压缩是将文件的大小减小以节省存储空间或网络传输时间的技术。常见的文件压缩格式包括ZIP、RAR、7Z等。文件打包通常指的是将多个文件或文件夹压缩成一个单独的文件。这在数据备份、软件分发和档案管理中非常常见。 3. 版本控制:在软件开发中,“版本”通常指软件的特定状态,版本号则用来标识这些状态。版本控制是一种记录文件、目录或集合随着时间变化的方式,以便将来可以检索特定版本。对于软件项目来说,版本控制是至关重要的,它不仅允许开发者追踪和管理代码的变化,而且还能帮助团队协作,解决冲突,并回滚到旧版本。 4. 软件管理系统的开发:一个软件管理系统可能是针对特定业务领域而设计的,它可能包括用户界面、数据库管理、业务逻辑处理、报告生成和其他许多功能。软件管理系统的开发通常涉及需求分析、系统设计、编程、测试和维护等多个阶段。 5. Python在软件开发中的应用:Python因为具有丰富的库和框架,被广泛用于开发各种类型的软件。例如,Django和Flask是用于Web开发的流行Python框架;而对于数据分析和数据科学任务,Pandas、NumPy和Matplotlib等库提供了强大的数据处理和可视化工具;对于机器学习和人工智能,TensorFlow、PyTorch等库使得复杂算法的实现变得更为简单。 6. 系统更新与维护:随着软件的使用和发展,需求可能会变化,新的问题可能会出现,所以软件系统需要定期进行更新和维护。软件更新可能包括修复已知问题、改进现有功能、增加新功能或优化性能。开发者需要评估是否需要为修复安全漏洞或提高系统性能而更新系统,以及更新之后对用户体验的影响。 由于文件名中只提到了“基于python的slaee管理系统”,没有提供该系统具体功能的详细描述,我们无法提供更加具体的技术知识点。如果需要分析系统的工作原理或具体的技术实现细节,还需要更多的信息。
recommend-type

【Keil-ARM编程艺术】:如何编写可维护且高效的代码

# 摘要 本文旨在为读者提供ARM微控制器编程和Keil开发环境的全面指南。第一章概览了ARM微控制
recommend-type

应用层协议概述

<think>首先,用户的问题是:“我想了解应用层协议的基本概念和常见类型 请问应用层协议简介 常见应用层协议概述”。这翻译成:“I want to understand the basic concepts of application layer protocols and common types. Please introduce application layer protocols and overview common application layer protocols.” 根据系统级指令: - 所有行内数学表达式必须使用$...$格式。 - 独立公式使用$$...$$格式
recommend-type

Delphi 12 TeeChartVCLFMX控件包下载及功能介绍

标题中提到的"Delphi 12 控件之TeeChartVCLFMX-2024.40.rar"指的是Delphi 12版本中使用的TeeChartVCLFMX图表控件的特定版本(2024.40版本)。Delphi是由Embarcadero Technologies开发的一款流行的集成开发环境(IDE),专门用于使用Object Pascal和C++语言开发软件应用程序。该标题强调了Delphi 12环境下TeeChartVCLFMX控件的使用,这表明Delphi的图形用户界面(GUI)组件库中包含了一个专门用于创建复杂图表和图形的组件。 从描述中仅能得到的关于文件的名称是"TeeChartVCLFMX-2024.40.rar",这意味着文件是一个压缩包,具体包含了一个TeeChartVCLFMX的图表控件,版本号为2024.40。它可能包含了在Delphi 12版本中使用该图表控件所需的所有文件,包括库文件、二进制文件、文档等。 标签"delphi 控件"简单而直接地指出了该文件属于Delphi编程环境中的一个控件类别,表明了目标用户是Delphi开发者,他们通常使用这些控件来丰富他们的应用程序界面或增强应用程序的功能。 文件名称列表提供了关于TeeChartVCLFMX压缩包内包含的具体文件及其用途的详细信息: 1. TeeChartVCLFMX-2024.40.exe:这个文件很可能是一个安装程序或可执行文件,用于安装或运行TeeChartVCLFMX图表控件。 2. Keygen.exe:这个文件名表明它可能是一个密钥生成器(Key Generator),用于生成软件的注册码或激活码,使得控件可以脱离试用限制或进行合法授权。 3. Delphi29Binaries-2024.40-windows.pak:这个文件名暗示它包含了特定于Windows平台的Delphi 29(可能指的是Delphi 12的内部版本号)的二进制文件。pak文件是压缩包的一种格式,可能包含了运行TeeChartVCLFMX图表控件所需的库文件、DLLs、组件文件等。 4. TeeChartVCLFMX-2024.40 - D12.pdf:这是一个PDF格式的文件,很可能是用户手册或帮助文档,提供了对TeeChartVCLFMX图表控件版本2024.40在Delphi 12中的使用说明,安装指南,功能介绍或示例代码等。 综合以上信息,可以推断TeeChartVCLFMX-2024.40压缩包是为Delphi 12的开发人员提供了一个专业的图表解决方案,使得用户能够将图表功能集成到他们用Delphi开发的应用程序中。TeeChartVCLFMX可能包含各种图表类型(如条形图、折线图、饼图等),以及丰富的定制选项,如颜色、样式、图例、数据绑定、交互式功能等。开发者可以利用TeeChartVCLFMX提供的图表控件在应用程序中创建强大的数据可视化功能,这对数据分析、科学计算、商业智能、财务报告等领域特别有用。 开发者需要使用Delphi 12 IDE配合提供的组件安装程序或执行文件安装和配置TeeChartVCLFMX控件,通过阅读PDF文档来了解如何使用控件,并在需要时使用Keygen.exe激活控件。Delphi29Binaries-2024.40-windows.pak文件可能包含了控件运行所需的核心二进制组件。通过合理使用这些资源,开发者可以将TeeChartVCLFMX控件集成到自己的项目中,快速构建功能丰富的图表和数据可视化组件。
recommend-type

【Keil-ARM性能优化全解】:代码监控与优化工具的实用技巧

# 摘要 本文对基于Keil-ARM平台的性能优化进行了系统性探讨,涵盖了性能监控工具的介绍、代码优化策略、系统资源管理以及综合案例分析。首先,介绍了Keil-ARM的性能监控工具及其在性能分析中的重要性,包括工具的配置和性能数据解读方法。其次,文中讨论了代码层面的优化,包括高效循环和条件语句的编写,函数内联与尾调用优化,以及编译器优化选项的应用。然后,深入分析了ARM系统资源分配、
recommend-type

电子邮箱协议

<think>首先,用户的问题是:“我想了解电子邮箱相关的协议 请问电子邮件协议有哪些”。这直接询问电子邮件协议的种类。 从系统级指令中,我需要: - 使用中文回答。 - 结构清晰,帮助用户逐步解决问题。 - 保证回答真实可靠。 - 在行内数学表达式使用 $...$,但这里可能没有数学内容。 - 独立公式使用 $$...$$,但可能不需要。 - 生成相关问题。 - 在引用的段落末尾添加引用标识如 [^1]。 参考提供的引用: - 引用[1]: 讨论了SMTP、POP3和IMAP。 - 引用[2]: 提到电子邮件系统采用客户机/服务器模式,涉及接收和发送邮件。 - 引用[3]: 详细描述了P