DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)

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

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

csdngif标识

目录

  • DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)
    • 📚前言
    • 📚页面效果
    • 📚指令输入
      • 定义属性
        • 容器相关属性
        • 子元素相关属性
      • 定义事件
      • 其他
    • 📚think
      • 📘组件代码
    • 📚代码测试
    • 📚测试代码正常跑通,附其他基本代码
      • 📘编写路由 src\router\index.js
      • 📘编写展示入口 src\App.vue
    • 📚页面效果
    • 📚相关文章


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

DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)

📚前言

DeepSeek 的发展也面临着一些技术挑战,如算力需求、数据质量和模型优化等问题。为了应对这些挑战,DeepSeek 采取了一系列有效的措施,如创新算法和架构设计、建立严格的数据治理体系、进行多方面的技术革新等,展现出了强大的技术实力和创新能力。

📚页面效果

 DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)页面效果图片

📚指令输入

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

定义属性

容器相关属性
  1. display

    • 作用:指定元素是否以弹性容器显示,虽然默认是弹性布局,但可以提供一个属性让用户选择是否开启。
    • 类型:Boolean
    • 默认值:true
    • 说明:当设置为 false 时,组件不使用弹性布局。
  2. flexDirection

    • 作用:定义主轴的方向,即子元素的排列方向。
    • 类型:String
    • 可选值:'row''row-reverse''column''column-reverse'
    • 默认值:'row'
  3. flexWrap

    • 作用:定义子元素是否换行。
    • 类型:String
    • 可选值:'nowrap''wrap''wrap-reverse'
    • 默认值:'nowrap'
  4. flexFlow

    • 作用:是 flexDirectionflexWrap 的缩写属性。
    • 类型:String
    • 默认值:undefined
    • 说明:如果设置了 flexFlow,则 flexDirectionflexWrap 的设置将被忽略。
  5. justifyContent

    • 作用:定义子元素在主轴上的对齐方式。
    • 类型:String
    • 可选值:'flex-start''flex-end''center''space-between''space-around''space-evenly'
    • 默认值:'flex-start'
  6. alignItems

    • 作用:定义子元素在交叉轴上的对齐方式。
    • 类型:String
    • 可选值:'flex-start''flex-end''center''baseline''stretch'
    • 默认值:'stretch'
  7. alignContent

    • 作用:定义多根轴线的对齐方式,如果子元素只有一根轴线,该属性不起作用。
    • 类型:String
    • 可选值:'flex-start''flex-end''center''space-between''space-around''stretch'
    • 默认值:'stretch'
子元素相关属性
  1. gap

    • 作用:定义子元素之间的间距。
    • 类型:String
    • 默认值:'0'
  2. inline

    • 作用:指定弹性容器是否为行内元素。
    • 类型:Boolean
    • 默认值:false

定义事件

  1. resize

    • 作用:当弹性容器大小改变时触发,可用于在容器大小变化时进行一些额外的处理,比如重新计算子元素的布局。
    • 参数:{ width: number, height: number },表示容器的新宽度和高度。
  2. childAdded

    • 作用:当有新的子元素添加到弹性容器时触发,可用于在子元素添加后进行一些初始化操作。
    • 参数:HTMLElement,表示新添加的子元素。
  3. childRemoved

    • 作用:当有子元素从弹性容器中移除时触发,可用于在子元素移除后进行一些清理操作。
    • 参数:HTMLElement,表示被移除的子元素。

其他

  1. 提供插槽:使用 Vue 的插槽机制,允许用户将任意内容插入到弹性容器中,增加组件的灵活性。
  2. 样式隔离:确保组件的样式不会影响到外部的其他元素,同时也不会被外部样式影响,可以使用 CSS 作用域或者 CSS Modules。
  3. 响应式设计:考虑结合媒体查询或者 Vue 的响应式数据,让弹性布局在不同的屏幕尺寸下有不同的表现。
  4. 文档和示例:编写详细的文档,说明每个属性和事件的作用,并提供一些使用示例,方便其他开发者使用该组件。

你有更好的建议也可以添加,要注明。组件定义好后给出5个及以上的调用示例,示例中添加完整的数据和事件,确保每个示例是独立的。
下面是现有目录
DeepSeekAndVue/
├── 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/
│ │ ├── ScrollAnimations/
│ │ ├── TextInput/
│ │ ├── Divider/
│ │ ├── Checkbox/
│ │ ├── TagInput/
│ │ ├── DropdownSelect/
│ │ ├── List/
│ │ ├── Header/
│ │ ├── Footer/
│ │ ├── Pagination/
│ │ ├── FloatingActionButton/
│ │ ├── PasswordInput/
│ │ ├── GridLayout/
│ │ ├── Flexbox/
│ │ ├── 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
│ │ ├── ScrollAnimationsView.vue
│ │ ├── TextInputView.vue
│ │ ├── DividerView.vue
│ │ ├── CheckboxView.vue
│ │ ├── TagInputView.vue
│ │ ├── DropdownSelectView.vue
│ │ ├── ListView.vue
│ │ ├── HeaderView.vue
│ │ ├── FooterView.vue
│ │ ├── PaginationView.vue
│ │ ├── FloatingActionButtonView.vue
│ │ ├── GridLayoutView.vue
│ │ ├── PasswordInputView.vue
│ │ ├── FlexboxView.vue
│ │ ├── DatePickerView.vue
│ │ └── AboutView.vue
│ ├── App.vue # 根组件
│ └── main.js # 应用入口
├── public/ # 公共资源目录
├── index.html # HTML 模板
├── package.json # 项目配置
├── vite.config.js # Vite 配置
└── node_modules/ # 依赖包目录

📚think

📘组件代码

我将为您创建一个功能完整的Flexbox组件,并提供使用示例。以下是组件的实现方案:

<!-- components/Flexbox/FlexContainer.vue -->
<template>
  <div
    ref="containerRef"
    class="flex-container"
    :style="containerStyles"
    @slotchange="handleSlotChange"
  >
    <slot></slot>
  </div>
</template>

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

const props = defineProps({
  display: {
    type: Boolean,
    default: true
  },
  flexDirection: {
    type: String,
    default: 'row',
    validator: (value) => [
      'row',
      'row-reverse',
      'column',
      'column-reverse'
    ].includes(value)
  },
  flexWrap: {
    type: String,
    default: 'nowrap',
    validator: (value) => ['nowrap', 'wrap', 'wrap-reverse'].includes(value)
  },
  flexFlow: String,
  justifyContent: {
    type: String,
    default: 'flex-start',
    validator: (value) => [
      'flex-start',
      'flex-end',
      'center',
      'space-between',
      'space-around',
      'space-evenly'
    ].includes(value)
  },
  alignItems: {
    type: String,
    default: 'stretch',
    validator: (value) => [
      'flex-start',
      'flex-end',
      'center',
      'baseline',
      'stretch'
    ].includes(value)
  },
  alignContent: {
    type: String,
    default: 'stretch',
    validator: (value) => [
      'flex-start',
      'flex-end',
      'center',
      'space-between',
      'space-around',
      'stretch'
    ].includes(value)
  },
  gap: {
    type: String,
    default: '0'
  },
  inline: {
    type: Boolean,
    default: false
  }
})

const emit = defineEmits(['resize', 'childAdded', 'childRemoved'])

const containerRef = ref(null)
let resizeObserver = null
let mutationObserver = null

const containerStyles = computed(() => {
  const styles = {
    gap: props.gap,
    justifyContent: props.justifyContent,
    alignItems: props.alignItems,
    alignContent: props.alignContent
  }

  if (props.display) {
    styles.display = props.inline ? 'inline-flex' : 'flex'
    styles.flexFlow = props.flexFlow 
      ? props.flexFlow 
      : `${props.flexDirection} ${props.flexWrap}`
  } else {
    styles.display = props.inline ? 'inline-block' : 'block'
  }

  return styles
})

const handleResize = (entries) => {
  for (const entry of entries) {
    const { width, height } = entry.contentRect
    emit('resize', { width, height })
  }
}

const handleMutation = (mutations) => {
  for (const mutation of mutations) {
    mutation.addedNodes.forEach(node => {
      if (node.nodeType === Node.ELEMENT_NODE) {
        emit('childAdded', node)
      }
    })
    mutation.removedNodes.forEach(node => {
      if (node.nodeType === Node.ELEMENT_NODE) {
        emit('childRemoved', node)
      }
    })
  }
}

onMounted(() => {
  // 初始化ResizeObserver
  resizeObserver = new ResizeObserver(handleResize)
  if (containerRef.value) {
    resizeObserver.observe(containerRef.value)
  }

  // 初始化MutationObserver
  mutationObserver = new MutationObserver(handleMutation)
  mutationObserver.observe(containerRef.value, {
    childList: true,
    subtree: false
  })
})

onUnmounted(() => {
  resizeObserver?.disconnect()
  mutationObserver?.disconnect()
})
</script>

<style scoped>
.flex-container {
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
}
</style>

以下是5个使用示例:

<!-- 示例1: 基本行布局 -->
<template>
  <FlexContainer>
    <div v-for="n in 3" :key="n" class="box">Item {{ n }}</div>
  </FlexContainer>
</template>

<script setup>
import FlexContainer from '@/components/Flexbox/FlexContainer.vue'
</script>

<style>
.box {
  padding: 20px;
  background: #eee;
  margin: 5px;
}
</style>

<!-- 示例2: 列布局居中 -->
<template>
  <FlexContainer 
    flex-direction="column"
    justify-content="center"
    align-items="center"
    gap="10px"
    style="height: 300px; border: 1px solid #ccc;"
  >
    <div v-for="n in 3" :key="n" class="box">Item {{ n }}</div>
  </FlexContainer>
</template>

<!-- 示例3: 换行布局 -->
<template>
  <FlexContainer
    flex-wrap="wrap"
    gap="20px"
    @resize="handleResize"
  >
    <div v-for="n in 8" :key="n" style="width: 200px" class="box">Item {{ n }}</div>
  </FlexContainer>
</template>

<script setup>
const handleResize = (size) => {
  console.log('Container size changed:', size)
}
</script>

<!-- 示例4: 响应式布局 -->
<template>
  <FlexContainer
    :flex-direction="isMobile ? 'column' : 'row'"
    :gap="isMobile ? '10px' : '20px'"
  >
    <div v-for="n in 4" :key="n" class="box">Item {{ n }}</div>
  </FlexContainer>
</template>

<script setup>
import { ref, onMounted, onUnmounted } from 'vue'

const isMobile = ref(false)

const checkMobile = () => {
  isMobile.value = window.innerWidth < 768
}

onMounted(() => {
  window.addEventListener('resize', checkMobile)
  checkMobile()
})

onUnmounted(() => {
  window.removeEventListener('resize', checkMobile)
})
</script>

<!-- 示例5: 事件处理 -->
<template>
  <FlexContainer
    @child-added="handleChildAdded"
    @child-removed="handleChildRemoved"
    @resize="handleResize"
    style="border: 1px solid #ddd; padding: 10px;"
  >
    <div v-for="item in items" :key="item" class="box">{{ item }}</div>
  </FlexContainer>
  <button @click="addItem">Add Item</button>
  <button @click="removeItem">Remove Item</button>
</template>

<script setup>
import { ref } from 'vue'

const items = ref(['A', 'B', 'C'])

const addItem = () => {
  items.value.push(String.fromCharCode(65 + items.value.length))
}

const removeItem = () => {
  if (items.value.length > 0) {
    items.value.pop()
  }
}

const handleChildAdded = (element) => {
  console.log('Child added:', element)
  element.style.backgroundColor = '#e3f2fd'
}

const handleChildRemoved = (element) => {
  console.log('Child removed:', element)
}

const handleResize = ({ width, height }) => {
  console.log(`New container size: ${width}x${height}`)
}
</script>

优化建议:

  1. 性能优化:添加防抖处理resize事件
  2. 可访问性:添加ARIA属性
  3. 边界处理:处理无效属性值
  4. 扩展性:添加子元素order/flex属性支持
  5. 调试支持:开发模式下显示布局轮廓

组件特点:

  1. 完整的Flexbox属性支持
  2. 响应式尺寸监控
  3. 子元素变化追踪
  4. 样式隔离
  5. 类型验证
  6. 完善的文档支持
  7. 灵活的事件处理
  8. 良好的浏览器兼容性

使用时可以根据需要添加自定义样式,组件会自动处理布局逻辑。事件系统可以帮助实现动态布局调整和动画效果。

📚代码测试

运行正常

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

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

📘编写路由 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')
    },
    {
      path: '/scrollAnimations',
      name: 'scrollAnimations',
      component: () => import('../views/ScrollAnimationsView.vue')
    },
    {
      path: '/textInputView',
      name: 'textInputView',
      component: () => import('../views/TextInputView.vue')
    },
    {
      path: '/divider',
      name: 'divider',
      component: () => import('../views/DividerView.vue')
    },
    {
      path: '/checkbox',
      name: 'checkbox',
      component: () => import('../views/CheckboxView.vue')
    },
    {
      path: '/tagInput',
      name: 'tagInput',
      component: () => import('../views/TagInputView.vue')
    },
    {
      path: '/dropdownSelect',
      name: 'dropdownSelect',
      component: () => import('../views/DropdownSelectView.vue')
    },
    {
      path: '/list',
      name: 'list',
      component: () => import('../views/ListView.vue')
    },
    {
      path: '/header',
      name: 'header',
      component: () => import('../views/HeaderView.vue')
    },
    {
      path: '/footer',
      name: 'footer',
      component: () => import('../views/FooterView.vue')
    },
    {
      path: '/pagination',
      name: 'pagination',
      component: () => import('../views/PaginationView.vue')
    },
    {
      path: '/floatingActionButton',
      name: 'floatingActionButton',
      component: () => import('../views/FloatingActionButtonView.vue')
    },
    {
      path: '/gridLayout',
      name: 'gridLayout',
      component: () => import('../views/GridLayoutView.vue')
    },
    {
      path: '/passwordInput',
      name: 'passwordInput',
      component: () => import('../views/PasswordInputView.vue')
    },
    {
      path: '/flexbox',
      name: 'flexbox',
      component: () => import('../views/FlexboxView.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>
        <RouterLink to="/scrollAnimations">ScrollAnimations</RouterLink>
        <RouterLink to="/textInputView">TextInput</RouterLink>
        <RouterLink to="/divider">Divider</RouterLink>
        <RouterLink to="/checkbox">Checkbox</RouterLink>
        <RouterLink to="/tagInput">TagInput</RouterLink>
        <RouterLink to="/dropdownSelect">DropdownSelect</RouterLink>
        <RouterLink to="/list">List</RouterLink>
        <RouterLink to="/header">Header</RouterLink>
        <RouterLink to="/footer">Footer</RouterLink>
        <RouterLink to="/pagination">Pagination</RouterLink>
        <RouterLink to="/floatingActionButton">FloatingActionButton</RouterLink>
        <RouterLink to="/gridLayout">GridLayout</RouterLink>
        <RouterLink to="/passwordInput">PasswordInput</RouterLink>
        <RouterLink to="/flexbox">Flexbox</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>

📚页面效果

 DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)页面效果图片

📚相关文章

 

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

 

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

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

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

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

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

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

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

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

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

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

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

  12. DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)https://blog.csdn.net/qq_33650655/article/details/145817161

  13. DeepSeek 助力 Vue 开发:打造丝滑的滚动动画(Scroll Animations)https://blog.csdn.net/qq_33650655/article/details/145818571

  14. DeepSeek 助力 Vue 开发:打造丝滑的文本输入框(Text Input)https://blog.csdn.net/qq_33650655/article/details/145837003

  15. DeepSeek 助力 Vue 开发:打造丝滑的分割线(Divider)https://blog.csdn.net/qq_33650655/article/details/145849100

  16. DeepSeek 助力 Vue 开发:打造丝滑的 复选框(Checkbox)https://blog.csdn.net/qq_33650655/article/details/145855695

  17. DeepSeek 助力 Vue3 开发:打造丝滑的标签输入(Tag Input)https://blog.csdn.net/qq_33650655/article/details/145858574

  18. DeepSeek 助力 Vue3 开发:打造丝滑的下拉选择框(Dropdown Select)https://blog.csdn.net/qq_33650655/article/details/145861882

  19. DeepSeek 助力 Vue3 开发:打造丝滑的列表(List)https://blog.csdn.net/qq_33650655/article/details/145866384

  20. DeepSeek 助力 Vue3 开发:打造丝滑的页眉(Header)https://blog.csdn.net/qq_33650655/article/details/145885122

  21. DeepSeek 助力 Vue3 开发:打造丝滑的页脚(Footer)https://blog.csdn.net/qq_33650655/article/details/145886306

  22. DeepSeek 助力 Vue3 开发:打造丝滑的分页(Pagination)https://blog.csdn.net/qq_33650655/article/details/145886824

  23. DeepSeek 助力 Vue3 开发:打造丝滑的悬浮按钮(Floating Action Button)
    https://blog.csdn.net/qq_33650655/article/details/145888339

  24. DeepSeek 助力 Vue3 开发:打造丝滑的网格布局(Grid Layout)https://blog.csdn.net/qq_33650655/article/details/145893422

  25. DeepSeek 助力 Vue3 开发:打造丝滑的密码输入框(Password Input)https://blog.csdn.net/qq_33650655/article/details/145903079

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


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

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

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

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

相关文章

qt 播放pcm音频

一、获取PCM音频 ffmpeg -i input.mp3 -acodec pcm_s16le -ar 44100 -ac 2 -f s16le output.pcm -acodec pcm_s16le&#xff1a;指定16位小端PCM编码格式&#xff08;兼容性最佳&#xff09;-ar 44100&#xff1a;设置采样率为CD标准44.1kHz&#xff08;可替换为16000/8000等&a…

OpenCV计算摄影学(15)无缝克隆(Seamless Cloning)调整图像颜色的函数colorChange()

操作系统&#xff1a;ubuntu22.04 OpenCV版本&#xff1a;OpenCV4.9 IDE:Visual Studio Code 编程语言&#xff1a;C11 算法描述 cv::colorChange 是 OpenCV 中用于调整图像颜色的函数。它允许你通过乘以不同的系数来独立地改变输入图像中红色、绿色和蓝色通道的强度&#xf…

WPS AI+office-ai的安装、使用

** 说明&#xff1a;WPS AI和OfficeAI是两个独立的AI助手&#xff0c;下面分别简单讲下如何使用 ** WPS AI WPS AI是WPS自带AI工具 打开新版WPS&#xff0c;新建文档后就可以看到菜单栏多了一个“WPS AI”菜单&#xff0c;点击该菜单&#xff0c;发现下方出现很多菜单&#xf…

绝美焦糖暖色调复古风景画面Lr调色教程,手机滤镜PS+Lightroom预设下载!

调色教程 通过 Lr 软件丰富的工具和功能&#xff0c;对风景照片在色彩、影调等方面进行调整。例如利用基本参数调整选项&#xff0c;精准控制照片亮度、对比度、色温、色调等基础要素&#xff1b;运用 HSL 面板可对不同色彩的色相、饱和度以及明亮度进行单独调节&#xff1b;利…

【Manus资料合集】激活码内测渠道+《Manus Al:Agent应用的ChatGPT时刻》(附资源)

DeepSeek 之后&#xff0c;又一个AI沸腾&#xff0c;冲击的不仅仅是通用大模型。 ——全球首款通用AI Agent的破圈启示录 2025年3月6日凌晨&#xff0c;全球AI圈被一款名为Manus的产品彻底点燃。由Monica团队&#xff08;隶属中国夜莺科技&#xff09;推出的“全球首款通用AI…

团队学习—系统思考

3月的团队学习将继续深入&#xff0c;与海外顾问共同探讨系统思考和心智模式的核心内容。回顾过去&#xff0c;这些每月一次的学习不仅成为我们审视思维框架的常规途径&#xff0c;更成为揭示潜在问题与盲点的高效工具。尤其是那些“我不知道我不知道”的领域&#xff0c;外部顾…

使用LVGL驱动三色墨水屏,Arduino

一、基本情况 本文代码基于以下软件版本&#xff1a; Arduino2.X LVGL8.3.11 GXEPD1.6.2 epdpaint---微雪EPD驱动的一部分&#xff0c;你可以在微雪的官网下载到 硬件&#xff1a; MCU&#xff1a;ESP32-S3-N16R8 屏幕&#xff1a;GDEY042Z98黑白红三色墨水屏&#xff0c;某…

DeepSeek未来发展趋势:开创智能时代的新风口

DeepSeek未来发展趋势&#xff1a;开创智能时代的新风口 随着人工智能&#xff08;AI&#xff09;、深度学习&#xff08;DL&#xff09;和大数据的飞速发展&#xff0c;众多创新型技术已经逐渐走向成熟&#xff0c;而DeepSeek作为这一领域的新兴力量&#xff0c;正逐步吸引越…

Go红队开发—编解码工具

文章目录 开启一个项目编解码工具开发Dongle包Base64编解码摩斯密码URL加解密AES加解密 MD5碰撞工具开发 开启一个项目 这作为补充内容&#xff0c;可忽略直接看下面的编解码&#xff1a; 一开始用就按照下面的步骤即可 1.创建一个文件夹&#xff0c;你自己定义名字(建议只用…

算法·搜索

搜索问题 搜索问题本质也是暴力枚举&#xff0c;一般想到暴力也要想到利用回溯枚举。 排序和组合问题 回溯法 去重问题&#xff1a;定义全局变量visited还是局部变量visited实现去重&#xff1f; 回溯问题 图论中的搜索问题 与一般的搜索问题一致&#xff0c;只不过要多…

常见的限流算法有哪些?

好的&#xff0c;关于这个问题&#xff0c;我会从几个方面来回答。 首先&#xff0c;限流算法是一种系统保护策略&#xff0c;主要是避免在流量高峰导致系统被压垮&#xff0c;造成系统不可用的问题。 常见的限流算法有 5 种。 1. &#xff08;如图&#xff09;计数器限流&a…

BetaFlight源码解读01

1.打开main.c init();run(); void systemInit(void) {int ret;clock_gettime(CLOCK_MONOTONIC, &start_time);printf("[system]Init...\n");SystemCoreClock 500 * 1e6; // virtual 500MHzif (pthread_mutex_init(&updateLock, NULL) ! 0) {printf("Cr…

FPGA-按键消抖

按键消抖 1. 原理 2. 关键程序实现 always (posedge clk or negedge rst) beginif(!rst)begincnt_wait < 26d0;end else if(flag_nege || flag_pose)begincnt_wait < 26d1;end else if(cnt_wait MAX_CNT) begincnt_wait < 26d0;end else if(cnt_wait > 26d0 &am…

Qt 进度条与多线程应用、基于 Qt 的文件复制工具开发

练习1&#xff1a;Qt 进度条与多线程应用 题目描述 开发一个基于 Qt 的应用程序&#xff0c;该应用程序包含一个水平进度条&#xff08;QSlider&#xff09;&#xff0c;并且需要通过多线程来更新进度条的值。请根据以下要求完成代码&#xff1a; 界面设计&#xff1a; 使用 QS…

C语言100天练习题【记录本】

C语言经典100题&#xff08;手把手 编程&#xff09; 可以在哔哩哔哩找到 已解决的天数&#xff1a;一&#xff0c;二&#xff0c;五&#xff0c;六 下面的都是模模糊糊的 可以学学这些算法&#xff0c;我是算法白痴&#xff0c;但是我不是白痴&#xff0c;可以学&#xff…

L1G5000XTuner 微调个人小助手认知

环境配置与数据准备 本节中&#xff0c;我们将演示如何安装 XTuner。 推荐使用 Python-3.10 的 conda 虚拟环境安装 XTuner。 步骤 0. 使用 conda 先构建一个 Python-3.10 的虚拟环境 cd ~ #git clone 本repo git clone https://github.com/InternLM/Tutorial.git -b camp4 mk…

【JavaEE】阻塞队列

【JavaEE】阻塞队列 一、什么是阻塞队列&#xff1f;二、阻塞队列的特点三、阻塞队列的常用方法3.1 抛出异常3.2 有返回结果&#xff0c;不会抛出异常3.3 阻塞 四、常见的阻塞队列4.1 ArrayBlockingQueue4.2 LinkedBlockingQueue4.3 SynchronousQueue4.4 PriorityBlockingQueue…

【Python项目】基于深度学习的车辆特征分析系统

【Python项目】基于深度学习的车辆特征分析系统 技术简介&#xff1a;采用Python技术、MySQL数据库、卷积神经网络&#xff08;CNN&#xff09;等实现。 系统简介&#xff1a;该系统基于深度学习技术&#xff0c;特别是卷积神经网络&#xff08;CNN&#xff09;&#xff0c;用…

蓝桥杯备赛:每日一题

只学习不思考不记笔记假把式 这道题目的难度很难&#xff0c;当然主要的原因在于模型的转化&#xff0c;刚看的这道题也是一脸懵&#xff0c;但是转换成覆盖模型后就好了很多&#xff0c;归跟接地就是每块区域的中取最大的最少的牛覆盖天数&#xff0c;然后根据这个天数求每一块…

7. 机器人记录数据集(具身智能机器人套件)

1. 树莓派启动机器人 conda activate lerobotpython lerobot/scripts/control_robot.py \--robot.typelekiwi \--control.typeremote_robot2. huggingface平台配置 huggingface官网 注册登录申请token&#xff08;要有写权限&#xff09;安装客户端 # 安装 pip install -U …