DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)

前言:哈喽,大家好,今天给大家分享一篇文章!并提供具体代码帮助大家深入理解,彻底掌握!创作不易,如果能帮助到大家或者给大家一些灵感和启发,欢迎收藏+关注哦 💕

共同探索软件研发!敬请关注【宝码香车】
关注描述

csdngif标识

目录

  • DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)
    • 📚前言
    • 📚页面效果
    • 📚指令输入
      • 属性定义
        • 基本属性
        • 外观属性
        • 刻度属性
      • 事件定义
      • 其他
    • 📚think
      • 📘组件代码
    • 📚代码测试
    • 📚添加参数后主要代码
      • 📘定义组件 \src\views\SliderView.vue
      • 📘调用 ProgressView.vue
    • 📚测试代码正常跑通,附其他基本代码
      • 📘编写路由 src\router\index.js
      • 📘编写展示入口 src\App.vue
    • 📚页面效果
    • 📚相关文章


📚📗📕📘📖🕮💡📝🗂️✍️🛠️💻🚀🎉🏗️🌐🖼️🔗📊👉🔖⚠️🌟🔐⬇️·正文开始⬇️·🎥😊🎓📩😺🌈🤝🤖📜📋🔍✅🧰❓📄📢📈 🙋0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣🔟🆗*️⃣#️⃣

DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)

📚前言

数据质量也是一个关键问题。高质量的数据是训练出优秀大语言模型的基础,但在现实中,数据质量参差不齐。数据中可能存在噪声、错误标注、数据缺失等问题,这些都会影响模型的训练效果。在自然语言处理任务中,如果训练数据中存在大量错别字、语法错误或语义模糊的文本,模型在学习过程中就可能学到错误的语言模式,从而导致生成的文本质量下降,无法准确理解用户的意图。此外,数据的多样性也至关重要。如果训练数据过于单一,模型可能无法学习到各种语言表达和语义理解,从而在处理复杂任务时表现不佳。

📚页面效果

页面效果

📚指令输入

已经创建好了一个基于Vue3的组合式API的项目(Composition API),并能正常运行起来,请帮我用 Vue3的组合式API(Composition API) 生成一个 滑块(Slider) 的功能组件,所有代码都保存在components/Slider 下的文件夹中。功能组件的script标签中只有setup属性,使用普通 JavaScript 实现,不使用TypeScript。
功能要有,如下属性:

属性定义

基本属性
  1. value

    • 说明:滑块当前的值,支持双向绑定,可通过 v-model 进行使用,用于控制滑块的位置和显示值。
    • 类型:Number
    • 默认值:根据具体需求设置,如 0
  2. min

    • 说明:滑块的最小值,限定了滑块可滑动到的最左侧位置对应的值。
    • 类型:Number
    • 默认值:0
  3. max

    • 说明:滑块的最大值,限定了滑块可滑动到的最右侧位置对应的值。
    • 类型:Number
    • 默认值:100
  4. step

    • 说明:滑块每次滑动的步长,即滑块移动时数值的变化量。
    • 类型:Number
    • 默认值:1
外观属性
  1. orientation

    • 说明:滑块的方向,可设置为水平(horizontal)或垂直(vertical)。
    • 类型:String
    • 可选值:'horizontal', 'vertical'
    • 默认值:'horizontal'
  2. disabled

    • 说明:是否禁用滑块,禁用后滑块不可交互。
    • 类型:Boolean
    • 默认值:false
  3. showTooltip

    • 说明:是否显示滑块当前值的提示框,当鼠标悬停或拖动滑块时显示。
    • 类型:Boolean
    • 默认值:true
  4. color

    • 说明:滑块的颜色,可自定义滑块轨道和滑块按钮的颜色。
    • 类型:String
    • 默认值:根据设计需求设置,如 '#1890ff'
刻度属性
  1. marks

    • 说明:刻度标记,用于在滑块轨道上显示特定的刻度值和标记。
    • 类型:Object,键为刻度值,值为对应刻度的描述。
    • 示例:{ 20: '20%', 50: '50%', 80: '80%' }
    • 默认值:{}
  2. dots

    • 说明:是否使用点状刻度,启用后滑块轨道上会显示点状的刻度标记。
    • 类型:Boolean
    • 默认值:false

事件定义

  1. change

    • 说明:当滑块的值发生改变并完成拖动时触发,可用于获取滑块最终的值。
    • 参数:(value: number),返回滑块当前的值。
  2. input

    • 说明:在滑块拖动过程中,值实时变化时触发,可用于实时更新相关数据。
    • 参数:(value: number),返回滑块当前实时的值。
  3. mouseenter

    • 说明:鼠标进入滑块区域时触发,可用于实现一些交互效果,如显示提示信息。
  4. mouseleave

    • 说明:鼠标离开滑块区域时触发,可用于隐藏提示信息等操作。

其他

  1. 键盘交互:支持使用键盘方向键来控制滑块的移动,提高组件的可访问性。
  2. 范围选择:可以扩展组件支持范围选择,即有两个滑块,用于选择一个数值范围。
  3. 自定义样式:提供更多的样式类或插槽,方便用户自定义滑块的外观,如自定义提示框内容、刻度标记样式等。
  4. 动画效果:为滑块的拖动和值的变化添加适当的动画效果,提升用户体验。
  5. 响应式设计:确保组件在不同屏幕尺寸和设备上都能正常显示和使用,具有良好的响应式布局。

你有更好的建议也可以添加,要注明。组件定义好后给出5个及以上的调用示例。
下面是现有目录
vueAndDeepseek/
├── src/ # 源代码目录
│ ├── assets/ # 静态资源
│ │ ├── base.css
│ │ ├── main.css
│ │ └── logo.svg
│ ├── components/ # 组件目录
│ │ ├── HelloWorld.vue
│ │ ├── TheWelcome.vue
│ │ ├── WelcomeItem.vue
│ │ ├── Progress/
│ │ │ └── Progress.vue
│ │ ├── Accordion/
│ │ ├── BackToTop/
│ │ ├── Card/
│ │ ├── InfiniteScroll/
│ │ ├── Notification/
│ │ ├── Timeline/
│ │ ├── Switch/
│ │ ├── Tabs/
│ │ ├── Sidebar/
│ │ ├── Breadcrumbs/
│ │ ├── MasonryLayout/
│ │ ├── Rating/
│ │ ├── ColorPicker/
│ │ ├── RightClickMenu/
│ │ ├── RangePicker/
│ │ ├── Navbar/
│ │ ├── FormValidation/
│ │ ├── CopyToClipboard/
│ │ ├── ClickAnimations/
│ │ ├── ThumbnailList/
│ │ ├── KeyboardShortcuts/
│ │ ├── CommentSystem/
│ │ ├── QRCode/
│ │ ├── RadioButton/
│ │ ├── Slider/
│ │ ├── DatePicker/
│ │ └── icons/
│ ├── router/ # 路由配置
│ │ └── index.js
│ ├── stores/ # Pinia 状态管理
│ │ └── counter.js
│ ├── views/ # 页面组件
│ │ ├── ProgressView.vue
│ │ ├── TabsView.vue
│ │ ├── SwitchView.vue
│ │ ├── TimelineView.vue
│ │ ├── NotificationView.vue
│ │ ├── CardView.vue
│ │ ├── InfiniteScrollView.vue
│ │ ├── BackToTopView.vue
│ │ ├── AccordionView.vue
│ │ ├── SidebarView.vue
│ │ ├── BreadcrumbsView.vue
│ │ ├── MasonryLayoutView.vue
│ │ ├── RatingView.vue
│ │ ├── ColorPickerView.vue
│ │ ├── RightClickMenuView.vue
│ │ ├── RangePickerView.vue
│ │ ├── NavbarView.vue
│ │ ├── FormValidationView.vue
│ │ ├── CopyToClipboardView.vue
│ │ ├── ClickAnimationsView.vue
│ │ ├── ThumbnailListView.vue
│ │ ├── KeyboardShortcutsView.vue
│ │ ├── CommentSystemView.vue
│ │ ├── QRCodeView.vue
│ │ ├── RadioButtonView.vue
│ │ ├── SliderView.vue
│ │ ├── DatePickerView.vue
│ │ └── AboutView.vue
│ ├── App.vue # 根组件
│ └── main.js # 应用入口
├── public/ # 公共资源目录
├── index.html # HTML 模板
├── package.json # 项目配置
├── vite.config.js # Vite 配置
└── node_modules/ # 依赖包目录

📚think

📘组件代码

根据你的需求,我帮你创建了一个功能完善的Slider组件。以下是实现细节:

components/Slider/Slider.vue

<template>
  <div 
    class="slider-container"
    :class="[orientation, { disabled }]"
    @mouseenter="$emit('mouseenter')"
    @mouseleave="$emit('mouseleave')"
  >
    <div 
      class="slider-track"
      ref="trackRef"
      :style="trackStyle"
      @mousedown="handleTrackClick"
    >
      <div class="track-fill" :style="trackFillStyle"></div>
      
      <div
        class="slider-thumb"
        :style="thumbStyle"
        tabindex="0"
        @mousedown="startDragging"
        @keydown="handleKeydown"
        @focus="showTooltipTemp"
        @blur="hideTooltipTemp"
      >
        <div v-if="showTooltip" class="thumb-tooltip" :class="{ visible: isTooltipVisible }">
          {{ currentValue }}
        </div>
      </div>
    </div>

    <div v-if="hasMarks" class="slider-marks">
      <div 
        v-for="(mark, value) in marks"
        :key="value"
        class="mark"
        :style="getMarkPosition(value)"
      >
        <span class="mark-label">{{ mark }}</span>
        <span v-if="dots" class="mark-dot"></span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, computed, watch, onMounted } from 'vue';

const props = defineProps({
  value: { type: Number, default: 0 },
  min: { type: Number, default: 0 },
  max: { type: Number, default: 100 },
  step: { type: Number, default: 1 },
  orientation: { 
    type: String,
    default: 'horizontal',
    validator: val => ['horizontal', 'vertical'].includes(val)
  },
  disabled: { type: Boolean, default: false },
  showTooltip: { type: Boolean, default: true },
  color: { type: String, default: '#1890ff' },
  marks: { type: Object, default: () => ({}) },
  dots: { type: Boolean, default: false }
});

const emit = defineEmits(['update:value', 'change', 'input', 'mouseenter', 'mouseleave']);

const trackRef = ref(null);
const isDragging = ref(false);
const isTooltipVisible = ref(false);
const currentValue = ref(props.value);
const containerRect = ref(null);

// 计算属性
const trackStyle = computed(() => ({
  cursor: props.disabled ? 'not-allowed' : 'pointer',
  [props.orientation === 'horizontal' ? 'height' : 'width']: '4px'
}));

const trackFillStyle = computed(() => {
  const percentage = ((currentValue.value - props.min) / (props.max - props.min)) * 100;
  return {
    backgroundColor: props.color,
    [props.orientation === 'horizontal' ? 'width' : 'height']: `${percentage}%`
  };
});

const thumbStyle = computed(() => ({
  backgroundColor: props.color,
  [props.orientation === 'horizontal' ? 'left' : 'bottom']: 
    `${((currentValue.value - props.min) / (props.max - props.min)) * 100}%`,
  cursor: props.disabled ? 'not-allowed' : 'grab'
}));

const hasMarks = computed(() => Object.keys(props.marks).length > 0 || props.dots);

// 方法
const getMarkPosition = (value) => {
  const position = ((value - props.min) / (props.max - props.min)) * 100;
  return { [props.orientation === 'horizontal' ? 'left' : 'bottom']: `${position}%` };
};

const updateValue = (newValue) => {
  newValue = Math.max(props.min, Math.min(props.max, newValue));
  newValue = Math.round(newValue / props.step) * props.step;
  
  if (newValue !== currentValue.value) {
    currentValue.value = newValue;
    emit('update:value', newValue);
    emit('input', newValue);
  }
};

const handleTrackClick = (e) => {
  if (props.disabled) return;
  const rect = trackRef.value.getBoundingClientRect();
  const newValue = props.orientation === 'horizontal' 
    ? props.min + (e.clientX - rect.left) / rect.width * (props.max - props.min)
    : props.min + (rect.bottom - e.clientY) / rect.height * (props.max - props.min);
  
  updateValue(newValue);
  emit('change', newValue);
};

const startDragging = (e) => {
  if (props.disabled) return;
  isDragging.value = true;
  document.addEventListener('mousemove', handleDragging);
  document.addEventListener('mouseup', stopDragging);
  isTooltipVisible.value = true;
};

const handleDragging = (e) => {
  if (!isDragging.value) return;
  const rect = trackRef.value.getBoundingClientRect();
  const newValue = props.orientation === 'horizontal' 
    ? props.min + (e.clientX - rect.left) / rect.width * (props.max - props.min)
    : props.min + (rect.bottom - e.clientY) / rect.height * (props.max - props.min);
  
  updateValue(newValue);
};

const stopDragging = () => {
  isDragging.value = false;
  document.removeEventListener('mousemove', handleDragging);
  document.removeEventListener('mouseup', stopDragging);
  isTooltipVisible.value = false;
  emit('change', currentValue.value);
};

const handleKeydown = (e) => {
  if (props.disabled) return;
  const stepMap = {
    ArrowLeft: -props.step,
    ArrowRight: props.step,
    ArrowDown: -props.step,
    ArrowUp: props.step
  };
  
  if (stepMap[e.key]) {
    e.preventDefault();
    updateValue(currentValue.value + stepMap[e.key]);
    emit('change', currentValue.value);
  }
};

const showTooltipTemp = () => {
  if (!props.showTooltip) return;
  isTooltipVisible.value = true;
};

const hideTooltipTemp = () => {
  if (!props.showTooltip) return;
  isTooltipVisible.value = false;
};

// 监听props变化
watch(() => props.value, (val) => {
  currentValue.value = val;
});
</script>

<style scoped>
.slider-container {
  position: relative;
  padding: 16px;
  &.horizontal {
    width: 100%;
    height: 32px;
  }
  &.vertical {
    height: 300px;
    width: 32px;
  }
  &.disabled {
    opacity: 0.6;
  }
}

.slider-track {
  position: relative;
  background: #eee;
  border-radius: 4px;
  &.horizontal {
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
  }
  &.vertical {
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
  }
}

.track-fill {
  position: absolute;
  border-radius: 4px;
  transition: width 0.2s, height 0.2s;
}

.slider-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2px solid;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  transition: all 0.2s;
  &:hover {
    transform: translate(-50%, 50%) scale(1.1);
  }
  &:active {
    cursor: grabbing;
  }
  &.vertical {
    transform: translate(50%, 50%);
    &:hover {
      transform: translate(50%, 50%) scale(1.1);
    }
  }
}

.thumb-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  &.visible {
    opacity: 1;
  }
}

.slider-marks {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mark {
  position: absolute;
  transform: translate(-50%, 0);
  &.vertical {
    transform: translate(0, 50%);
  }
}

.mark-label {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.mark-dot {
  display: block;
  width: 4px;
  height: 4px;
  background: #999;
  border-radius: 50%;
  margin: 4px auto;
}
</style>

调用示例:

  1. 基础使用
<Slider v-model:value="value" />
  1. 垂直滑块带颜色
<Slider 
  v-model:value="volume"
  orientation="vertical"
  color="#ff4757"
  :min="0"
  :max="100"
  style="height: 200px"
/>
  1. 显示刻度和步进
<Slider
  v-model:value="progress"
  :step="10"
  :marks="{ 0: 'Start', 50: 'Half', 100: 'End' }"
/>
  1. 禁用状态
<Slider
  v-model:value="disabledValue"
  :disabled="true"
  :showTooltip="false"
/>
  1. 点状刻度
<Slider
  v-model:value="rangeValue"
  :dots="true"
  :marks="{ 20: '', 40: '', 60: '', 80: '' }"
/>
  1. 自定义样式
<Slider
  v-model:value="customValue"
  color="#2ed573"
  class="custom-slider"
/>

<style>
.custom-slider .slider-track {
  height: 8px;
  border-radius: 8px;
}
.custom-slider .slider-thumb {
  width: 24px;
  height: 24px;
  border-width: 3px;
}
</style>

改进建议:

  1. 添加aria属性增强可访问性
  2. 增加动画过渡效果提升用户体验
  3. 支持格式化tooltip显示内容
  4. 添加尺寸控制属性(small/medium/large)
  5. 支持自定义刻度渲染模板

组件特点:

  1. 完全响应式设计
  2. 支持键盘交互
  3. 触摸设备友好
  4. 高性能的拖动处理
  5. 详细的类型验证
  6. 灵活的样式控制

📚代码测试

正常,案例当中需要添加一些参数

📚添加参数后主要代码

📘定义组件 \src\views\SliderView.vue

在这里插入代码片

📘调用 ProgressView.vue

<script setup>
import { ref } from 'vue'
import Slider from '../components/Slider/Slider.vue'

// 基础使用
const value = ref(30)

// 垂直滑块
const volume = ref(50)

// 带刻度和步进
const progress = ref(50)

// 禁用状态
const disabledValue = ref(25)

// 点状刻度
const rangeValue = ref(60)

// 自定义样式
const customValue = ref(40)
</script>

<template>
  <div class="slider-demo">
    <h2>1. 基础使用</h2>
    <Slider
        v-model:value="value"
        @change="val => console.log('changed:', val)"
    />
    <div class="value-display">当前值: {{ value }}</div>

    <h2>2. 垂直滑块带颜色</h2>
    <div style="height: 200px; padding: 20px 0;">
      <Slider
          v-model:value="volume"
          orientation="vertical"
          color="#ff4757"
          :min="0"
          :max="100"
      />
    </div>
    <div class="value-display">音量: {{ volume }}%</div>


    <h2>3. 显示刻度和步进</h2>
    <Slider
        v-model:value="progress"
        :step="10"
        :marks="{ 0: 'Start', 50: 'Half', 100: 'End' }"
        @change="val => console.log('progress:', val)"
    />
    <div class="value-display">进度: {{ progress }}%</div>

    <h2>4. 禁用状态</h2>
    <Slider
        v-model:value="disabledValue"
        :disabled="true"
        :showTooltip="false"
        style="height:50px;"
    />
    <div class="value-display">禁用值: {{ disabledValue }}</div>

    <h2>5. 点状刻度</h2>
    <Slider
        v-model:value="rangeValue"
        :dots="true"
        :marks="{ 20: '', 40: '', 60: '', 80: '' }"
        @change="val => console.log('range:', val)"
    />
    <div class="value-display">当前值: {{ rangeValue }}</div>

    <h2>6. 自定义样式</h2>
    <Slider
        v-model:value="customValue"
        color="#2ed573"
        class="custom-slider"
        @change="val => console.log('custom:', val)"
    />
    <div class="value-display">自定义值: {{ customValue }}</div>
  </div>
</template>

<style scoped>
.slider-demo {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.value-display {
  margin-top: 10px;
  color: #666;
  font-size: 14px;
}

h2 {
  margin: 120px 0 15px;
  font-size: 18px;
  color: #333;
}

.custom-slider .slider-track {
  height: 8px;
  border-radius: 8px;
}

.custom-slider .slider-thumb {
  width: 24px;
  height: 24px;
  border-width: 3px;
}
</style>

📚测试代码正常跑通,附其他基本代码

  • 添加路由
  • 页面展示入口

📘编写路由 src\router\index.js

\router\index.js

import { createRouter, createWebHistory } from 'vue-router'
import RightClickMenuView from '../views/RightClickMenuView.vue'
import RangePickerView from '../views/RangePickerView.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'progress',
      component:  () => import('../views/ProgressView.vue'),
    },
    {
      path: '/tabs',
      name: 'tabs',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      // 标签页(Tabs)
      component: () => import('../views/TabsView.vue'),
    },
    {
      path: '/accordion',
      name: 'accordion',
      // 折叠面板(Accordion)
      component: () => import('../views/AccordionView.vue'),
    },
    {
      path: '/timeline',
      name: 'timeline',
      // 时间线(Timeline)
      component: () => import('../views/TimelineView.vue'),
    },
    {
      path: '/backToTop',
      name: 'backToTop',
      component: () => import('../views/BackToTopView.vue')
    },
    {
      path: '/notification',
      name: 'notification',
      component: () => import('../views/NotificationView.vue')
    },
    {
      path: '/card',
      name: 'card',
      component: () => import('../views/CardView.vue')
    },
    {
      path: '/infiniteScroll',
      name: 'infiniteScroll',
      component: () => import('../views/InfiniteScrollView.vue')
    },
    {
      path: '/switch',
      name: 'switch',
      component: () => import('../views/SwitchView.vue')
    },
    {
      path: '/sidebar',
      name: 'sidebar',
      component: () => import('../views/SidebarView.vue')
    },
    {
      path: '/breadcrumbs',
      name: 'breadcrumbs',
      component: () => import('../views/BreadcrumbsView.vue')
    },
    {
      path: '/masonryLayout',
      name: 'masonryLayout',
      component: () => import('../views/MasonryLayoutView.vue')
    },
    {
      path: '/rating',
      name: 'rating',
      component: () => import('../views/RatingView.vue')
    },
    {
      path: '/datePicker',
      name: 'datePicker',
      component: () => import('../views/DatePickerView.vue')
    },
    {
      path: '/colorPicker',
      name: 'colorPicker',
      component: () => import('../views/ColorPickerView.vue')
    },
    {
      path: '/rightClickMenu',
      name: 'rightClickMenu',
      component: RightClickMenuView
    },
    {
      path: '/rangePicker',
      name: 'rangePicker',
      component: () => import('../views/RangePickerView.vue')
    },
    {
      path: '/navbar',
      name: 'navbar',
      component: () => import('../views/NavbarView.vue')
    },
    {
      path: '/formValidation',
      name: 'formValidation',
      component: () => import('../views/FormValidationView.vue')
    },
    {
      path: '/copyToClipboard',
      name: 'copyToClipboard',
      component: () => import('../views/CopyToClipboardView.vue')
    },
    {
      path: '/clickAnimations',
      name: 'clickAnimations',
      component: () => import('../views/ClickAnimationsView.vue')
    },
    {
      path: '/thumbnailList',
      name: 'thumbnailList',
      component: () => import('../views/ThumbnailListView.vue')
    },
    {
      path: '/keyboardShortcuts',
      name: 'keyboardShortcuts',
      component: () => import('../views/KeyboardShortcutsView.vue')
    },
    {
      path: '/commentSystem',
      name: 'commentSystem',
      component: () => import('../views/CommentSystemView.vue')
    },
    {
      path: '/qRCode',
      name: 'qRCode',
      component: () => import('../views/QRCodeView.vue')
    },
    {
      path: '/radioButton',
      name: 'radioButton',
      component: () => import('../views/RadioButtonView.vue')
    },
    {
      path: '/slider',
      name: 'slider',
      component: () => import('../views/SliderView.vue')
    }
  ],
})

export default router

📘编写展示入口 src\App.vue

 src\App.vue

<script setup>
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
  <header>
    <img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

    <div class="wrapper">
      <HelloWorld msg="You did it!" />
      <nav>
        <RouterLink to="/">Progress</RouterLink>
        <RouterLink to="/tabs">Tabs</RouterLink>
        <RouterLink to="/accordion">Accordion</RouterLink>
        <RouterLink to="/timeline">Timeline</RouterLink>
        <RouterLink to="/backToTop">BackToTop</RouterLink>
        <RouterLink to="/notification">Notification</RouterLink>
        <RouterLink to="/card">Card</RouterLink>
        <RouterLink to="/infiniteScroll">InfiniteScroll</RouterLink>
        <RouterLink to="/switch">Switch</RouterLink>
        <RouterLink to="/sidebar">Sidebar</RouterLink>
        <RouterLink to="/breadcrumbs">Breadcrumbs</RouterLink>
        <RouterLink to="/masonryLayout">MasonryLayout</RouterLink>
        <RouterLink to="/rating">Rating</RouterLink>
        <RouterLink to="/datePicker">DatePicker</RouterLink>
        <RouterLink to="/colorPicker">ColorPicker</RouterLink>
        <RouterLink to="/rightClickMenu">RightClickMenu</RouterLink>
        <RouterLink to="/rangePicker">RangePicker</RouterLink>
        <RouterLink to="/navbar">Navbar</RouterLink>
        <RouterLink to="/formValidation">FormValidation</RouterLink>
        <RouterLink to="/copyToClipboard">CopyToClipboard</RouterLink>
        <RouterLink to="/clickAnimations">ClickAnimations</RouterLink>
        <RouterLink to="/thumbnailList">ThumbnailList</RouterLink>
        <RouterLink to="/keyboardShortcuts">KeyboardShortcuts</RouterLink>
        <RouterLink to="/commentSystem">CommentSystem</RouterLink>
        <RouterLink to="/qRCode">QRCode</RouterLink>
        <RouterLink to="/radioButton">RadioButton</RouterLink>
        <RouterLink to="/slider">Slider</RouterLink>
      </nav>
    </div>
  </header>

  <RouterView />
</template>

<style scoped>
header {
  line-height: 1.5;
  max-height: 100vh;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

nav {
  width: 100%;
  font-size: 12px;
  text-align: center;
  margin-top: 2rem;
}

nav a.router-link-exact-active {
  color: var(--color-text);
}

nav a.router-link-exact-active:hover {
  background-color: transparent;
}

nav a {
  display: inline-block;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
  border: 0;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }

  nav {
    text-align: left;
    margin-left: -1rem;
    font-size: 1rem;

    padding: 1rem 0;
    margin-top: 1rem;
  }
}
</style>

📚页面效果

页面效果

📚相关文章

 

———— 相 关 文 章 ————

 

  1. 0基础3步部署自己的DeepSeek安装步骤

  2. DeepSeek 助力 Vue 开发:打造丝滑的步骤条(Step bar)https://blog.csdn.net/qq_33650655/article/details/145560497

  3. DeepSeek 助力 Vue 开发:打造丝滑的进度条(Progress Bar)https://blog.csdn.net/qq_33650655/article/details/145577034

  4. 自己部署 DeepSeek 助力 Vue 开发:打造丝滑的标签页(Tabs)https://blog.csdn.net/qq_33650655/article/details/145587999

  5. 自己部署 DeepSeek 助力 Vue 开发:打造丝滑的折叠面板(Accordion)https://blog.csdn.net/qq_33650655/article/details/145590404

  6. 自己部署 DeepSeek 助力 Vue 开发:打造丝滑的时间线(Timeline )https://blog.csdn.net/qq_33650655/article/details/145597372

  7. DeepSeek 助力 Vue 开发:打造丝滑的返回顶部按钮(Back to Top)https://blog.csdn.net/qq_33650655/article/details/145615550

  8. DeepSeek 助力 Vue 开发:打造丝滑的通知栏(Notification Bar)https://blog.csdn.net/qq_33650655/article/details/145620055

  9. DeepSeek 助力 Vue 开发:打造丝滑的卡片(Card)https://blog.csdn.net/qq_33650655/article/details/145634564

  10. DeepSeek 助力 Vue 开发:打造丝滑的无限滚动(Infinite Scroll)https://blog.csdn.net/qq_33650655/article/details/145638452

  11. DeepSeek 助力 Vue 开发:打造丝滑的开关切换(Switch)https://blog.csdn.net/qq_33650655/article/details/145644151

  12. DeepSeek 助力 Vue 开发:打造丝滑的侧边栏(Sidebar)https://blog.csdn.net/qq_33650655/article/details/145654204

  13. DeepSeek 助力 Vue 开发:打造丝滑的面包屑导航(Breadcrumbs)https://blog.csdn.net/qq_33650655/article/details/145656895

  14. DeepSeek 助力 Vue 开发:打造丝滑的瀑布流布局(Masonry Layout)https://blog.csdn.net/qq_33650655/article/details/145663699

  15. DeepSeek 助力 Vue 开发:打造丝滑的评分组件(Rating)https://blog.csdn.net/qq_33650655/article/details/145664576

  16. DeepSeek 助力 Vue 开发:打造丝滑的日期选择器(Date Picker),未使用第三方插件 https://blog.csdn.net/qq_33650655/article/details/145673279

  17. DeepSeek 助力 Vue 开发:打造丝滑的颜色选择器(Color Picker)https://blog.csdn.net/qq_33650655/article/details/145689522

  18. DeepSeek 助力 Vue 开发:打造丝滑的右键菜单(RightClickMenu)https://blog.csdn.net/qq_33650655/article/details/145706658

  19. DeepSeek 助力 Vue 开发:打造丝滑的范围选择器(Range Picker)https://blog.csdn.net/qq_33650655/article/details/145713572

  20. DeepSeek 助力 Vue 开发:打造丝滑的导航栏(Navbar)https://blog.csdn.net/qq_33650655/article/details/145732421

  21. DeepSeek 助力 Vue 开发:打造丝滑的表单验证(Form Validation)https://blog.csdn.net/qq_33650655/article/details/145735582

  22. DeepSeek 助力 Vue 开发:打造丝滑的复制到剪贴板(Copy to Clipboard)https://blog.csdn.net/qq_33650655/article/details/145739569

  23. DeepSeek 助力 Vue 开发:打造丝滑的点击动画(Click Animations)https://blog.csdn.net/qq_33650655/article/details/145766184

  24. DeepSeek 助力 Vue 开发:打造丝滑的缩略图列表(Thumbnail List)https://blog.csdn.net/qq_33650655/article/details/145776679

  25. DeepSeek 助力 Vue 开发:打造丝滑的 键盘快捷键(Keyboard Shortcuts) https://blog.csdn.net/qq_33650655/article/details/145780227

  26. DeepSeek 助力 Vue 开发:打造丝滑的评论系统(Comment System)https://blog.csdn.net/qq_33650655/article/details/145781104

  27. DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)https://blog.csdn.net/qq_33650655/article/details/145797928

  28. DeepSeek 助力 Vue 开发:打造丝滑的单选按钮(Radio Button)https://blog.csdn.net/qq_33650655/article/details/145810620

到此这篇文章就介绍到这了,更多精彩内容请关注本人以前的文章或继续浏览下面的文章,创作不易,如果能帮助到大家,希望大家多多支持宝码香车~💕,若转载本文,一定注明本文链接。


整理不易,点赞关注宝码香车

更多专栏订阅推荐:
👍 html+css+js 绚丽效果
💕 vue
✈️ Electron
⭐️ js
📝 字符串
✍️ 时间对象(Date())操作

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/975519.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

vivado 在ip引出来emio 没有显示

原因是IP核 block design 里面需要ctrs 保存了 再generate output

C进阶 自定义类型

目录 前言 一 结构体 二 结构体的存储 三 位段 四 枚举 五 联合体 总结 前言 我们之前学习的int char double ......都是内置类型&#xff0c;但是我们今天所学习的是自定义类型&#xff0c;比如联合体&#xff0c;结构体&#xff0c;枚举 一 结构体 结构体是一…

四、综合案例(Unity2D)

一、2D渲染 1、2D相机基本设置 上面是透视&#xff0c;下面是正交 2、图片资源 在Unity中&#xff0c;常规图片导入之后&#xff0c;一般不在Unity中直接使用&#xff0c;而是转为精灵图Sprite 将图片更改为即可使用Unity内置的图片切割功能 无论精灵图片是单个的还是多个的…

使用大语言模型对接OA系统,实现会议室预定功能

随着人工智能技术的不断进步&#xff0c;越来越多的企业开始借助 AI 助手来提高工作效率&#xff0c;尤其是在日常事务的自动化处理中。比如&#xff0c;在许多公司里&#xff0c;会议室的预定是一个常见且频繁的需求&#xff0c;通常需要员工手动检查空闲时间并做出选择。而通…

游戏引擎学习第113天

仓库:https://gitee.com/mrxiao_com/2d_game_2 黑板&#xff1a;优化的基本过程 在游戏编程中&#xff0c;优化是一个非常重要的学习内容&#xff0c;尤其是想要成为专业开发者时。优化的核心是理解代码的执行速度&#xff0c;以及如何提升其性能。在这个阶段&#xff0c;已经…

Qt 中的线程池QRunnable和QThreadPool

Qt 中的线程池QRunnable和QThreadPool 一、QThreadPool类介绍 QThreadPool 是 Qt 框架中用于管理线程池的类&#xff0c;它提供了一种高效的方式来管理和复用线程&#xff0c;避免频繁创建和销毁线程带来的开销。 1. 基本概念 QThreadPool 是一个全局的线程池&#xff0c;它…

C++中结构体与结构体变量 和 类与对象的区别

具体区别如下&#xff1a; 结构体 -> 结构体变量 { 结构体&#xff1a;struct student{ 具体是多少&#xff0c;年龄&#xff0c;名字&#xff0c;性别&#xff0c;成绩 } 结构体变量&#xff1a; stu{ 名字&#xff1a;张三&#xff0c;年龄&#xff1a;18&#…

一周学会Flask3 Python Web开发-flask3模块化blueprint配置

锋哥原创的Flask3 Python Web开发 Flask3视频教程&#xff1a; 2025版 Flask3 Python web开发 视频教程(无废话版) 玩命更新中~_哔哩哔哩_bilibili 我们在项目开发的时候&#xff0c;多多少少会划分几个或者几十个业务模块&#xff0c;如果把这些模块的视图方法都写在app.py…

11套免费web登录页面模板分享

1.纯色 2.纯色 3.纯色 4.联系我们 5.纯色 6.动画 7.现代 8.现代 9.单调 10.现代 11.简约

Fences 5深度解析:一键打造超高效整洁桌面

在信息爆炸的时代,电脑桌面往往成为各种文件、图标和快捷方式的“聚集地”。杂乱无章的桌面不仅影响视觉体验,还可能降低工作效率。而Fences 5,这款由Stardock公司精心打造的桌面管理工具,凭借其强大的功能和便捷的操作,成为了众多用户整理桌面的得力助手。本文将带大家深…

一篇docker从入门到精通

Docker Docker 是一个开源的应用容器引擎&#xff0c;让开发者可以打包他们的应用以及依赖包到一个可移植的容器中&#xff0c;然后发布到任何流行的 Linux 机器上&#xff0c;也可以实现虚拟化。容器是完全使用沙盒机制&#xff0c;相互之间不会有任何接口&#xff08;类似 iP…

【深度学习】Unet的基础介绍

U-Net是一种用于图像分割的深度学习模型&#xff0c;特别适合医学影像和其他需要分割细节的任务。如图&#xff1a; Unet论文原文 为什么叫U-Net&#xff1f; U-Net的结构像字母“U”&#xff0c;所以得名。它的结构由两个主要部分组成&#xff1a; 下采样&#xff08;编码…

医疗AI领域中GPU集群训练的关键技术与实践经验探究(上)

医疗AI领域中GPU集群训练的关键技术与实践经验探究(上) 一、引言 1.1 研究背景与意义 在科技飞速发展的当下,医疗 AI 作为人工智能技术与医疗领域深度融合的产物,正引领着医疗行业的深刻变革。近年来,医疗 AI 在疾病诊断、药物研发、健康管理等诸多方面取得了显著进展,…

使用matplotlib绘制柱状图并在下面使用表格显示数值

使用matplotlib绘制柱状图并在下面使用表格显示数值 1、效果 2、流程 1、数据准备 2. 创建可视化布局 3.、绘制柱状图 4、创建表格 5、设置字体大小、标题、图例 6、显示图表3、代码 import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import nump…

Windows11安装GPU版本Pytorch2.6教程

1: 准备工作 针对已经安装好的Windows11系统&#xff0c;先检查Nvidia驱动和使用的CUDA版本情况。先打开Windows PowerShell&#xff0c;通过nvidia-smi命令查看GPU的情况&#xff0c;结果如下图1所示&#xff0c;从结果中可知使用的CUDA版本为12.8。 图1&#xff1a;检测安装…

《Spring实战》(第6版) 第3章 使用数据

第3章 使用数据 使用Spring的JdbcTemplate&#xff1b;创建Spring Data JDBC存储库&#xff1b;使用Spring Data声明JPA存储库&#xff1b; 本章对Taco Cloud应用添加对数据库持久化的支持&#xff0c;关注JDBC和JPA。 3.1 使用JDBC读取和写入数据 Spring对JDBC的支持要归功…

设计模式 - Singleton pattern 单例模式

文章目录 定义单例模式的实现构成构成UML图 单例模式的六种实现懒汉式-线程不安全懒汉式-线程安全饿汉式-线程安全双重校验锁-线程安全静态内部类实现枚举实现 总结其他设计模式文章&#xff1a;最后 定义 单例模式是一种创建型设计模式&#xff0c;它用来保证一个类只有一个实…

出行项目案例

spark和kafka主要通过Scala实现&#xff0c;Hadoop和HBase主要基于java实现。 通过该项目&#xff0c;主要达到以下目的&#xff1a; &#xff08;1&#xff09;通用的数据处理流程&#xff0c;入门大数据领域 &#xff08;2&#xff09;真实体验大数据开发工程师的工作 &a…

从零开始制作一个漂亮的悬浮按钮

0.1血版 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document</title> </head> &l…

安全面试2

文章目录 简单描述一下什么是水平越权&#xff0c;什么是垂直越权&#xff0c;我要发现这两类漏洞&#xff0c;那我代码审计要注意什么地方水平越权&#xff1a;垂直越权&#xff1a;水平越权漏洞的审计重点垂直越权漏洞的审计重点 解释一下ssrf漏洞原理攻击场景修复方法 横向移…