DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)

news2025/2/25 10:00:46

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

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

csdngif标识

目录

  • DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)
    • 📚前言
    • 📚页面效果
    • 📚指令输入
      • 属性定义
        • 基本内容属性
        • 样式属性
        • 其他属性
      • 事件定义
      • 其他
        • 性能优化
        • 兼容性
        • 可访问性
        • 扩展性
      • 📘组件代码
    • 📚代码测试
    • 📚整理后主要代码
      • 📘定义组件 \src\components\QRCode\QRCode.vue
      • 📘调用 \src\views\QRCodeView.vue
    • 📚测试代码正常跑通,附其他基本代码
      • 📘编写路由 src\router\index.js
      • 📘编写展示入口 src\App.vue
    • 📚页面效果
    • 📚相关文章


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

DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)

📚前言

日活用户数方面,DeepSeek 的增长势头同样强劲。国内 AI 产品榜的最新统计数据显示,DeepSeek 应用在上线仅 20 天后,其日活跃用户数(DAU)迅速突破 2000 万大关,具体数字高达 2215 万 。这一成绩不仅彰显了 DeepSeek 强大的用户吸引力,也进一步证明了 AI 技术在当今社会的广泛应用和巨大潜力。到 2 月 1 日,DeepSeek 日活跃用户突破 3000 万大关,成为史上最快达到这一里程碑的应用 。其日活跃用户数已达到 ChatGPT 日活跃用户数的 41.6%,并成功超越了豆包的日活跃用户数 1695 万 。在上线仅 21 天后,DeepSeek 的月活跃用户数(MAU)便达到了 3370 万,使其在全球 AI 产品月活总榜上成功跻身前四 。

DeepSeek 的出现,对美国科技股和全球 AI 市场产生了深远的影响。在美股市场,1 月 27 日,美股 AI、芯片股重挫,英伟达收盘大跌超过 17%,单日市值蒸发 5890 亿美元,创下美国股市历史上最高纪录 。这一现象反映出 DeepSeek 的崛起对美国科技巨头的市场地位构成了挑战,引发了投资者对科技股未来前景的担忧。

📚页面效果

页面效果

📚指令输入

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

属性定义

基本内容属性
  • value:这是最核心的属性,用于指定要编码到二维码中的数据,比如文本、链接等。二维码的生成就是基于这个值来进行的,它可以是字符串类型,用户需要根据实际需求传入相应的内容。
  • type:指定二维码的纠错级别。纠错级别决定了二维码在部分损坏的情况下仍能被正确扫描的能力,常见的取值有L(低,7%纠错)、M(中,15%纠错)、Q(高,25%纠错)、H(最高,30%纠错)。
样式属性
  • size:用于控制二维码的尺寸大小,单位可以是像素(px)。它决定了二维码在页面上显示的物理大小,方便根据不同的布局需求进行调整。
  • colorDark:设置二维码中深色模块(通常是黑色)的颜色。可以使用十六进制颜色码、RGB 或 RGBA 等格式来指定颜色,满足不同的设计风格。
  • colorLight:设置二维码中浅色模块(通常是白色)的颜色,同样可以使用十六进制颜色码、RGB 或 RGBA 等格式。
  • margin:定义二维码周围的空白边距,单位为像素。适当的边距可以使二维码在页面上更加美观,也有助于提高扫描的成功率。
其他属性
  • version:手动指定二维码的版本号。二维码版本从 1 到 40,版本越高,所能容纳的数据量就越大。一般情况下不需要手动指定,组件会根据传入的数据自动选择合适的版本,但在某些特殊需求下可以使用该属性。

事件定义

  • @generated:当二维码成功生成时触发该事件,事件回调函数中可以获取到生成的二维码对象或者相关的状态信息,方便开发者在二维码生成后进行后续的操作,比如将二维码保存为图片等。
  • @error:在二维码生成过程中出现错误时触发该事件,事件回调函数会携带错误信息,开发者可以根据错误信息进行相应的处理,如提示用户重新输入数据等。

其他

性能优化
  • 采用虚拟列表技术:如果在一个页面中需要生成多个二维码,使用虚拟列表可以只渲染当前可见区域的二维码,减少不必要的渲染开销,提高页面性能。
  • 缓存机制:对于相同数据生成的二维码进行缓存,避免重复生成,提高生成效率。
兼容性
  • 确保组件在不同浏览器和设备上都能正常显示和使用,进行充分的兼容性测试,特别是在移动设备上,要考虑不同屏幕分辨率和浏览器内核的差异。
可访问性
  • 为二维码添加适当的alt属性,当二维码无法正常显示时,屏幕阅读器可以读取该属性内容,为视觉障碍用户提供必要的信息。
扩展性
  • 提供扩展接口,允许开发者自定义二维码的生成算法或者样式处理逻辑,方便根据不同的业务需求进行定制化开发。

你有更好的建议也可以添加,要注明。组件定义好后给出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/
│ │ ├── 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
│ │ ├── DatePickerView.vue
│ │ └── AboutView.vue
│ ├── App.vue # 根组件
│ └── main.js # 应用入口
├── public/ # 公共资源目录
├── index.html # HTML 模板
├── package.json # 项目配置
├── vite.config.js # Vite 配置
└── node_modules/ # 依赖包目录

📘组件代码

下面按照您的要求创建二维码组件:

components/QRCode/QRCode.vue

<template>
  <div class="qr-code">
    <div ref="qrCodeRef"></div>
    <span class="sr-only">QR Code: {{ value }}</span>
  </div>
</template>

<script setup>
import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
import QRCode from 'qrcodejs2'

const props = defineProps({
  value: {
    type: String,
    required: true
  },
  type: {
    type: String,
    default: 'H',
    validator(value) {
      return ['L', 'M', 'Q', 'H'].includes(value.toUpperCase())
    }
  },
  size: {
    type: Number,
    default: 200
  },
  colorDark: {
    type: String,
    default: '#000000'
  },
  colorLight: {
    type: String,
    default: '#ffffff'
  },
  margin: {
    type: Number,
    default: 4
  },
  version: {
    type: Number,
    default: undefined
  }
})

const emit = defineEmits(['generated', 'error'])

const qrCodeRef = ref(null)
let qrCodeInstance = null
const cache = new Map()

const generateCacheKey = () => {
  return JSON.stringify({
    value: props.value,
    type: props.type,
    size: props.size,
    colorDark: props.colorDark,
    colorLight: props.colorLight,
    margin: props.margin,
    version: props.version
  })
}

const generateQRCode = () => {
  if (!props.value) {
    emit('error', new Error('QR code value is required'))
    return
  }

  const cacheKey = generateCacheKey()
  if (cache.has(cacheKey)) {
    updateFromCache(cache.get(cacheKey))
    return
  }

  try {
    if (qrCodeInstance) {
      qrCodeInstance.clear()
      qrCodeInstance = null
    }

    qrCodeInstance = new QRCode(qrCodeRef.value, {
      text: props.value,
      width: props.size,
      height: props.size,
      colorDark: props.colorDark,
      colorLight: props.colorLight,
      correctLevel: QRCode.CorrectLevel[props.type.toUpperCase()],
      cellspacing: props.margin,
      version: props.version
    })

    observeQRGeneration(cacheKey)
  } catch (error) {
    emit('error', error)
  }
}

const observeQRGeneration = (cacheKey) => {
  const observer = new MutationObserver(() => {
    const img = qrCodeRef.value.querySelector('img')
    const canvas = qrCodeRef.value.querySelector('canvas')
    
    if (img) {
      img.onload = () => handleSuccess(img.src, cacheKey)
      img.alt = `QR Code: ${props.value.substring(0, 50)}`
    } else if (canvas) {
      handleSuccess(canvas.toDataURL(), cacheKey)
    }
    observer.disconnect()
  })

  observer.observe(qrCodeRef.value, { childList: true })
}

const handleSuccess = (dataUrl, cacheKey) => {
  cache.set(cacheKey, dataUrl)
  emit('generated', dataUrl)
}

const updateFromCache = (dataUrl) => {
  qrCodeRef.value.innerHTML = `
    <img 
      src="${dataUrl}" 
      alt="QR Code: ${props.value.substring(0, 50)}" 
      style="width: ${props.size}px; height: ${props.size}px"
    >
  `
  emit('generated', dataUrl)
}

onMounted(generateQRCode)
onBeforeUnmount(() => qrCodeInstance?.clear())

watch(() => generateCacheKey(), generateQRCode)
</script>

<style scoped>
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.qr-code {
  display: inline-block;
  line-height: 0;
}
</style>

调用示例 (views/QRCodeView.vue):

<template>
  <div class="examples">
    <!-- 基础用法 -->
    <QRCode value="https://deepseek.com" />

    <!-- 自定义颜色和尺寸 -->
    <QRCode
      value="https://deepseek.com"
      :size="250"
      color-dark="#2c3e50"
      color-light="#ecf0f1"
    />

    <!-- 带边距和事件处理 -->
    <QRCode
      value="Event Example"
      :margin="10"
      @generated="handleGenerated"
      @error="handleError"
    />

    <!-- 指定版本和纠错级别 -->
    <QRCode
      value="Version Control Example"
      :version="5"
      type="Q"
    />

    <!-- 动态数据绑定 -->
    <input v-model="dynamicValue" placeholder="输入二维码内容">
    <QRCode :value="dynamicValue" />
  </div>
</template>

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

const dynamicValue = ref('')
const handleGenerated = (dataUrl) => {
  console.log('生成成功:', dataUrl)
}
const handleError = (error) => {
  console.error('生成失败:', error)
}
</script>

<style scoped>
.examples {
  display: grid;
  gap: 2rem;
  padding: 2rem;
}

input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 300px;
}
</style>

组件特点:

  1. 使用qrcodejs2实现二维码生成
  2. 添加了缓存机制提升性能
  3. 支持响应式属性变化
  4. 完善的错误处理和事件通知
  5. 可访问性优化(屏幕阅读器支持)
  6. 自动清理旧实例避免内存泄漏
  7. MutationObserver监听DOM变化确保事件触发
  8. 类型校验和参数验证

扩展建议:

  1. 可以添加二维码下载功能
  2. 支持二维码Logo叠加
  3. 添加loading状态提示
  4. 支持扫描结果解码预览
  5. 添加二维码有效性验证功能

📚代码测试

会有一个报错

TypeError: Cannot read properties of undefined (reading '_android')

📚整理后主要代码

📘定义组件 \src\components\QRCode\QRCode.vue

<template>
  <div class="qr-code">
    <QrcodeVue
        :value="value"
        :size="size"
        :level="type"
        :background="colorLight"
        :foreground="colorDark"
        :margin="margin"
        :version="version"
        @render="handleGenerated"
        @renderError="handleError"
    />
    <span class="sr-only">QR Code: {{ value }}</span>
  </div>
</template>

<script setup>
import {onMounted} from 'vue'
import QrcodeVue from 'qrcode.vue'

const props = defineProps({
  value: {
    type: String,
    required: true
  },
  type: {
    type: String,
    default: 'H',
    validator(value) {
      return ['L', 'M', 'Q', 'H'].includes(value.toUpperCase())
    }
  },
  size: {
    type: Number,
    default: 200
  },
  colorDark: {
    type: String,
    default: '#000000'
  },
  colorLight: {
    type: String,
    default: '#ffffff'
  },
  margin: {
    type: Number,
    default: 4
  },
  version: {
    type: Number,
    default: undefined
  }
})

const emit = defineEmits(['generated', 'error'])

const handleGenerated = (dataUrl) => {
  emit('generated', dataUrl)
}

const handleError = (error) => {
  emit('error', error)
}

onMounted(() => {
  if (!props.value) {
    emit('error', new Error('QR code value is required'))
  }
})
</script>

<style scoped>
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.qr-code {
  display: inline-block;
  line-height: 0;
}
</style>

📘调用 \src\views\QRCodeView.vue

<template>
  <div class="qrcode-demo">
    <h2>二维码生成示例</h2>

    <!-- 示例1:基础用法 -->
    <section class="demo-section">
      <h3>基础用法</h3>
      <div class="demo-box">
        <QRCode value="https://deepseek.com" />
        <div class="description">
          默认配置的二维码
        </div>
      </div>
    </section>

    <!-- 示例2:自定义样式 -->
    <section class="demo-section">
      <h3>自定义样式</h3>
      <div class="demo-box">
        <QRCode
            value="https://deepseek.com"
            :size="250"
            color-dark="#2c3e50"
            color-light="#ecf0f1"
        />
        <div class="description">
          自定义大小和颜色
        </div>
      </div>
    </section>

    <!-- 示例3:带事件处理 -->
    <section class="demo-section">
      <h3>事件处理</h3>
      <div class="demo-box">
        <QRCode
            value="Event Example"
            :margin="10"
            @generated="handleGenerated"
            @error="handleError"
        />
        <div class="status-message" :class="{ error: hasError }">
          {{ statusMessage }}
        </div>
      </div>
    </section>

    <!-- 示例4:纠错级别 -->
    <section class="demo-section">
      <h3>纠错级别</h3>
      <div class="demo-box">
        <QRCode
            value="Error Correction Example"
            type="Q"
        />
        <div class="description">
          使用 Q 级别纠错(约25%)
        </div>
      </div>
    </section>

    <!-- 示例5:动态内容 -->
    <section class="demo-section">
      <h3>动态内容</h3>
      <div class="demo-box">
        <div class="input-group">
          <input
              v-model="dynamicValue"
              placeholder="输入二维码内容"
              class="demo-input"
          >
        </div>
        <QRCode
            :value="dynamicValue || '请输入内容'"
            :size="200"
        />
      </div>
    </section>
  </div>
</template>

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

const dynamicValue = ref('')
const statusMessage = ref('')
const hasError = ref(false)

const handleGenerated = (dataUrl) => {
  statusMessage.value = '二维码生成成功!'
  hasError.value = false
  console.log('QR Code generated:', dataUrl)
}

const handleError = (error) => {
  statusMessage.value = '生成失败:' + error.message
  hasError.value = true
  console.error('QR Code generation failed:', error)
}
</script>

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

h2 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
}

.demo-section {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
}

h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.demo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 6px;
}

.description {
  color: #666;
  font-size: 14px;
  text-align: center;
}

.input-group {
  width: 100%;
  max-width: 300px;
  margin-bottom: 15px;
}

.demo-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
}

.demo-input:focus {
  outline: none;
  border-color: #409eff;
}

.status-message {
  padding: 8px 12px;
  border-radius: 4px;
  background: #f0f9eb;
  color: #67c23a;
  font-size: 14px;
}

.status-message.error {
  background: #fef0f0;
  color: #f56c6c;
}

@media (max-width: 768px) {
  .qrcode-demo {
    padding: 10px;
  }

  .demo-section {
    padding: 15px;
  }

  .demo-box {
    padding: 15px;
  }
}
</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')
    }
  ],
})

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>
      </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

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


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

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

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

图像处理篇---图像处理中常见参数

文章目录 前言一、分贝&#xff08;dB&#xff09;的原理1.公式 二、峰值信噪比&#xff08;PSNR, Peak Signal-to-Noise Ratio&#xff09;1.用途2.公式3.示例 三、信噪比&#xff08;SNR, Signal-to-Noise Ratio&#xff09;1.用途2.公式3.示例 四、动态范围&#xff08;Dyna…

【Java】—— 二叉树

一、树型结构 树形结构是一种重要的数据结构&#xff0c;它类似于现实生活中的树的结构&#xff0c;由结点和边构成。树形结构具有以下特点&#xff1a; 树形结构是一种层次化的结构&#xff0c;由根结点、内部结点和叶子结点组成。根结点是树的顶部结点&#xff0c;没有父结点…

机场导航系统有哪些功能?精准定位与高效路径规划技术深度剖析

本文专为关注机场服务优化、乘客体验提升的IT技术员及航空业同仁而写。将深入探讨机场室内导航系统的核心功能&#xff0c;旨在解决乘客在机场内部定位、路径规划、服务寻找等方面的痛点。如需获取机场导航系统解决方案可前往文章最下方获取&#xff0c;如有项目合作及技术交流…

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

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

STM32-智能小车项目

项目框图 ST-link接线 实物图&#xff1a; 正面&#xff1a; 反面&#xff1a; 相关内容 使用L9110S电机模块 电机驱动模块L9110S详解 | 良许嵌入式 一、让小车动起来 新建文件夹智能小车项目 在里面复制19-串口打印功能 重命名为01-让小车动起来 新建文件夹motor&…

星环科技推出DeepSeek全场景解决方案:即开即用、企业级部署、端侧智能三位一体

星环科技&#xff08;688031.SH&#xff09;正式发布DeepSeek全场景解决方案&#xff0c;全面覆盖个人用户、企业客户及行业场景需求&#xff0c;为用户提供从个人到企业、从云端到本地的全方位AI应用支持&#xff0c;为不同需求的用户提供了灵活、高效且安全的AI解决方案。 省…

《全星质量管理 QMS 软件系统》:赋能企业高效质量管理

《全星质量管理 QMS 软件系统》&#xff1a;赋能企业高效质量管理 在当今竞争激烈的商业环境中&#xff0c;《全星质量管理 QMS 软件系统》脱颖而出&#xff0c;展现出了显著且无可比拟的应用优势。 首先&#xff0c;《全星质量管理 QMS 软件系统》犹如一张严密的质量管控大网…

【多模态处理篇三】【DeepSeek语音合成:TTS音色克隆技术揭秘】

最近帮某明星工作室做AI语音助手时遇到魔幻需求——要求用5秒的咳嗽声克隆出完整音色!传统TTS系统直接翻车,生成的语音像得了重感冒的电音怪物。直到祭出DeepSeek的TTS音色克隆黑科技,才让AI语音从"机器朗读"进化到"声临其境"。今天我们就来扒开这个声音…

C++Qt学习笔记——实现一个串口通信界面

CQt学习笔记——实现一个串口通信界面 一.界面二、项目结构三、头文件1. 文件头部2. 类定义3. 构造函数和析构函数4. 成员函数5. 成员变量 四、代码解析ReceiveAeraInit 函数解析SerialHelper 构造函数解析1. 为什么有两个 SerialHelper&#xff1f;2. 为什么用 :: 和 :&#x…

Word(2010)排版技巧

设置标题样式 选择需要设置的标题 如下图所示。选择文字后&#xff0c;点击对应的样式即可设置。 设置标题格式 设置字体格式 设置段落格式 显示所有样式 标题样式展示 建议 建议新建一个正文样式&#xff0c;可以命名为正文1&#xff0c;因为所有的样式参考的“样式基准…

一.Vue中的条件渲染

1.在<head>中引用 <script src"https://unpkg.com/vue3/dist/vue.global.js"></script> 2.在<body>中写入 <div id"app"><p><a v-if "user.usernameadmin"href"#">编辑</a><a …

IO进程 day05

IO进程 day05 9. 进程9. 9. 守护进程守护进程的特点守护进程创建步骤 10. 线程10.1. 线程的概念10.2. 进程和线程的区别10.2. 线程资源10.3. 线程的函数接口1. pthread_create-创建线程线程函数和普通函数的区别 2. pthread_exit3.线程资源回收函数join和detach的区别 获取线程…

【HeadFirst系列之HeadFirstJava】第6天之认识Java的API:解锁高效开发的钥匙

认识Java的API&#xff1a;解锁高效开发的钥匙 在《Head First Java》的第六章节中&#xff0c;作者深入探讨了Java的API&#xff08;Application Programming Interface&#xff09;&#xff0c;并强调了它在Java开发中的重要性。Java API 是Java开发工具包&#xff08;JDK&a…

4 - AXI GPIO按键控制LED实验

文章目录 1 实验任务2 系统框图3 软件设计 1 实验任务 本实验任务是通过调用PL端AXI GPIO IP核&#xff0c;使用中断机制&#xff0c;实现PL端按键控制 PS端LED的功能。 2 系统框图 3 软件设计 注意事项&#xff1a; AXI GPIO IP核是双沿触发中断&#xff0c;不可设置&…

题海拾贝:扫雷

Hello大家好&#xff01;很高兴我们又见面啦&#xff01;给生活添点passion&#xff0c;开始今天的编程之路&#xff01; 我的博客&#xff1a;<但凡. 我的专栏&#xff1a;《编程之路》、《数据结构与算法之美》、《题海拾贝》 欢迎点赞&#xff0c;关注&#xff01; 1、题…

Deepseek本地部署小实践(c盘)

目录 前言 一、安装ollama 二、打开终端执行run 三、可视化 前言 小鲸鱼出来以后看到很多大佬本地部署AI&#xff0c;自己也想试一试&#xff0c;第一次部署AI&#xff0c;选了一个简单的办法&#xff0c;实践一下&#xff0c;写得比较粗糙。 一、安装ollama 先简单的介绍…

详细解析d3dx9_27.dll丢失怎么办?如何快速修复d3dx9_27.dll

运行程序时提示“d3dx9_27.dll文件缺失”&#xff0c;通常由DirectX组件损坏或文件丢失引起。此问题可通过系统化修复方法解决&#xff0c;无需重装系统或软件。下文将详细说明具体步骤及注意事项。 一.d3dx9_27.dll缺失问题的本质解析 当系统提示“d3dx9_27.dll丢失”时&…

【LeetCode刷题之路】leetcode155.最小栈

LeetCode刷题记录 &#x1f310; 我的博客主页&#xff1a;iiiiiankor&#x1f3af; 如果你觉得我的内容对你有帮助&#xff0c;不妨点个赞&#x1f44d;、留个评论✍&#xff0c;或者收藏⭐&#xff0c;让我们一起进步&#xff01;&#x1f4dd; 专栏系列&#xff1a;LeetCode…

Vue全局变量的定义和使用,创建 Store变量、读取、修改

在VUE中&#xff0c;当需要各js、各页面都能读写的全局变量时&#xff0c;可以用store变量&#xff0c;从定义到使用的方法如下 一&#xff0e;定义变量&#xff0c;例&#xff1a;我们定一个全局变量gxh 找到 vue的/ src/ store路径, 在 modules文件夹下创建文件gvar.js 在…

基于Docker的前端环境管理:从开发环境到生产部署的实现方案

# 基于Docker的前端环境管理&#xff1a;从开发环境到生产部署的实现方案 简介及前端开发环境挑战 简介 是一种容器化平台&#xff0c;可以将应用程序及其依赖项打包为一个容器&#xff0c;提供一种轻量级、可移植的环境。它能够简化开发、部署和运维的流程&#xff0c;提高…