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

目录
- [DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加行拖拽排序功能示例4,TableView16_04 跨表格拖拽示例](#DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加行拖拽排序功能示例4,TableView16_04 跨表格拖拽示例)
📚📗📕📘📖🕮💡📝🗂️✍️🛠️💻🚀🎉🏗️🌐🖼️🔗📊👉🔖⚠️🌟🔐⬇️·正文开始
⬇️·🎥😊🎓📩😺🌈🤝🤖📜📋🔍✅🧰❓📄📢📈 🙋0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣🔟🆗*️⃣#️⃣
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加行拖拽排序功能示例4,TableView16_04 跨表格拖拽示例
📚前言
2025 年 1 月 20 日,DeepSeek 发布新一代推理模型 DeepSeek-R1,这是 DeepSeek 发展历程中的又一个重要里程碑。DeepSeek-R1 在数学、代码、自然语言推理等任务上,性能比肩 OpenAI o1 正式版,同时通过知识蒸馏等技术,显著提升了推理性能。该模型的发布,使得 DeepSeek 在人工智能领域的竞争力进一步增强,也为用户提供了更强大、更智能的服务。它在解决复杂问题、进行逻辑推理和代码生成等方面的出色表现,赢得了用户和行业专家的高度认可。
📚页面效果

📘组件代码
html
<!-- TableView16_04.vue 跨表格拖拽示例 -->
<template>
<div class="drag-demo">
<h2>04. 跨表格拖拽交换数据</h2>
<div class="instructions">
<p>拖动任务项可在两个表格之间交换数据。每次拖动会自动更新任务状态。</p>
</div>
<div class="table-group">
<div class="table-section">
<h3>待处理任务</h3>
<div class="drop-zone"
@dragover.prevent
@dragenter.prevent="isDraggingFromRight && (isDraggingOverLeft = true)"
@dragleave="isDraggingOverLeft = false"
@drop="handleDropToLeft"
:class="{'active-zone': isDraggingFromRight || isDraggingOverLeft}">
<Table
class="left-table"
:data="leftData"
:columns="columns"
draggable
@update:data="handleLeftUpdate"
row-key="id"
border
table-id="left"
>
<!-- 添加拖拽指示器 -->
<template #cell-task="{ row }">
<div class="task-cell"
@dragstart="handleLeftDragStart(row, $event)"
draggable="true">
{{ row.task }}
<span class="drag-icon">☰</span>
</div>
</template>
</Table>
</div>
</div>
<div class="table-section">
<h3>已完成任务</h3>
<div class="drop-zone"
@dragover.prevent
@dragenter.prevent="isDraggingFromLeft && (isDraggingOver = true)"
@dragleave="isDraggingOver = false"
@drop="handleDropToRight"
:class="{'active-zone': isDraggingFromLeft || isDraggingOver}">
<Table
class="right-table"
:data="rightData"
:columns="columns"
draggable
@update:data="handleRightUpdate"
row-key="id"
border
table-id="right"
>
<!-- 添加拖拽指示器 -->
<template #cell-task="{ row }">
<div class="task-cell"
@dragstart="handleRightDragStart(row, $event)"
draggable="true">
{{ row.task }}
<span class="drag-icon">☰</span>
</div>
</template>
</Table>
</div>
</div>
</div>
<div class="drag-info">
<div v-if="dragHistory.length" class="history">
<h3>拖拽历史记录</h3>
<ul>
<li v-for="(record, index) in dragHistory" :key="index">
{{ record.task }} - 从 {{ record.from }} 移动到 {{ record.to }}
<span class="time-stamp">{{ new Date(record.timestamp).toLocaleTimeString() }}</span>
</li>
</ul>
<button class="clear-btn" @click="clearHistory">清除记录</button>
</div>
</div>
<div class="debug-panel" v-if="showDebug">
<h3>调试面板</h3>
<button @click="showDebug = false">关闭</button>
<div class="debug-content">
<div>
<h4>左表数据</h4>
<pre>{{ JSON.stringify(leftData, null, 2) }}</pre>
</div>
<div>
<h4>右表数据</h4>
<pre>{{ JSON.stringify(rightData, null, 2) }}</pre>
</div>
<div>
<h4>当前拖拽项</h4>
<pre>{{ JSON.stringify(currentDragItem, null, 2) }}</pre>
</div>
</div>
</div>
<button class="debug-toggle" @click="showDebug = !showDebug">
{{ showDebug ? '隐藏' : '显示' }}调试信息
</button>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import Table from '@/components/Table/Table.vue'
const columns = [
{ title: '任务', dataIndex: 'task', width: '200px' },
{ title: '优先级', dataIndex: 'priority', width: '80px' },
{ title: '状态', dataIndex: 'status', width: '120px' }
]
// 初始数据
const leftData = ref([
{ id: 1, task: '需求分析', priority: '高', status: '待处理' },
{ id: 2, task: 'UI设计', priority: '中', status: '待处理' },
{ id: 3, task: '接口文档', priority: '高', status: '待处理' }
])
const rightData = ref([
{ id: 4, task: '原型设计', priority: '高', status: '已完成' },
{ id: 5, task: '需求评审', priority: '中', status: '已完成' },
{ id: 6, task: '环境配置', priority: '低', status: '已完成' }
])
// 拖拽历史记录
const dragHistory = ref([])
const showDebug = ref(false)
const currentDragItem = ref(null)
const isDraggingFromLeft = ref(false)
const isDraggingFromRight = ref(false)
const dragSourceTable = ref(null) // 'left' 或 'right'
const isDraggingOver = ref(false)
const isDraggingOverLeft = ref(false)
// 添加一个长期存储的变量来保存最后一次拖拽的项目
const lastDragItem = ref(null)
const lastDragSource = ref(null)
// 处理左侧表格数据更新
const handleLeftUpdate = (newData) => {
leftData.value = newData
}
// 处理右侧表格数据更新
const handleRightUpdate = (newData) => {
rightData.value = newData
}
// 左侧表格项目拖拽开始
const handleLeftDragStart = (row, event) => {
// 存储拖拽数据到两个变量中
currentDragItem.value = { ...row }
lastDragItem.value = { ...row }
// 设置拖拽状态
isDraggingFromLeft.value = true
isDraggingFromRight.value = false
dragSourceTable.value = 'left'
lastDragSource.value = 'left'
// 设置拖拽数据 - 尝试添加更多格式
try {
const data = JSON.stringify({
source: 'left',
id: row.id,
data: row
})
event.dataTransfer.setData('text/plain', data)
// 尝试添加一个简单的标识符
event.dataTransfer.setData('application/x-source', 'left')
// 设置简单属性
event.dataTransfer.setData('id', row.id.toString())
} catch (e) {
console.warn('设置拖拽数据失败:', e)
}
// 设置拖拽效果
event.dataTransfer.effectAllowed = 'move'
// 添加拖拽结束监听
window.addEventListener('dragend', handleDragEnd, { once: true })
console.log('从左侧开始拖拽:', row)
}
// 右侧表格项目拖拽开始 (同样进行修改)
const handleRightDragStart = (row, event) => {
// 存储拖拽数据到两个变量中
currentDragItem.value = { ...row }
lastDragItem.value = { ...row }
// 设置拖拽状态
isDraggingFromRight.value = true
isDraggingFromLeft.value = false
dragSourceTable.value = 'right'
lastDragSource.value = 'right'
// 设置拖拽数据
try {
const data = JSON.stringify({
source: 'right',
id: row.id,
data: row
})
event.dataTransfer.setData('text/plain', data)
// 尝试添加一个简单的标识符
event.dataTransfer.setData('application/x-source', 'right')
// 设置简单属性
event.dataTransfer.setData('id', row.id.toString())
} catch (e) {
console.warn('设置拖拽数据失败:', e)
}
// 设置拖拽效果
event.dataTransfer.effectAllowed = 'move'
// 添加拖拽结束监听
window.addEventListener('dragend', handleDragEnd, { once: true })
console.log('从右侧开始拖拽:', row)
}
// 处理拖拽到右侧表格
const handleDropToRight = (event) => {
event.preventDefault()
console.log('拖拽到右侧表格开始')
console.log('拖拽来源:', dragSourceTable.value, '最后拖拽来源:', lastDragSource.value)
console.log('是否从左侧拖拽:', isDraggingFromLeft.value)
try {
// 使用当前拖拽项或最后拖拽项
const dragItem = currentDragItem.value || lastDragItem.value
const dragSource = dragSourceTable.value || lastDragSource.value
console.log('使用的拖拽项:', dragItem)
console.log('使用的拖拽来源:', dragSource)
// 检查是否有效并且来自左侧
if (!dragItem || dragSource !== 'left') {
console.log('无效拖拽或来源不是左侧')
return
}
// 检查项目是否在左侧表格
const itemId = dragItem.id
const itemIndex = leftData.value.findIndex(row => row.id === itemId)
if (itemIndex === -1) {
console.log('项目不在左侧表格中,id:', itemId)
return
}
// 从左侧表格移除项目
const item = leftData.value[itemIndex]
leftData.value.splice(itemIndex, 1)
// 确保项目状态正确
const updatedItem = { ...item, status: '已完成' }
// 添加到右侧表格
rightData.value.push(updatedItem)
// 记录历史
dragHistory.value.push({
task: updatedItem.task,
from: '待处理任务',
to: '已完成任务',
timestamp: new Date()
})
// 保存到本地存储
saveToLocalStorage()
console.log('成功拖拽到右侧:', updatedItem)
} catch (err) {
console.error('拖拽到右侧发生错误:', err)
} finally {
// 在处理完成后清除当前拖拽信息,但保留最后拖拽信息
// 使用setTimeout确保状态重置不影响其他处理
setTimeout(() => {
isDraggingFromLeft.value = false
currentDragItem.value = null
isDraggingOver.value = false
}, 100)
}
}
// 对左侧表格的处理函数也做相应修改
const handleDropToLeft = (event) => {
event.preventDefault()
console.log('拖拽到左侧表格开始')
console.log('拖拽来源:', dragSourceTable.value, '最后拖拽来源:', lastDragSource.value)
console.log('是否从右侧拖拽:', isDraggingFromRight.value)
try {
// 使用当前拖拽项或最后拖拽项
const dragItem = currentDragItem.value || lastDragItem.value
const dragSource = dragSourceTable.value || lastDragSource.value
console.log('使用的拖拽项:', dragItem)
console.log('使用的拖拽来源:', dragSource)
// 检查是否有效并且来自右侧
if (!dragItem || dragSource !== 'right') {
console.log('无效拖拽或来源不是右侧')
return
}
// 检查项目是否在右侧表格
const itemId = dragItem.id
const itemIndex = rightData.value.findIndex(row => row.id === itemId)
if (itemIndex === -1) {
console.log('项目不在右侧表格中,id:', itemId)
return
}
// 从右侧表格移除项目
const item = rightData.value[itemIndex]
rightData.value.splice(itemIndex, 1)
// 确保项目状态正确
const updatedItem = { ...item, status: '待处理' }
// 添加到左侧表格
leftData.value.push(updatedItem)
// 记录历史
dragHistory.value.push({
task: updatedItem.task,
from: '已完成任务',
to: '待处理任务',
timestamp: new Date()
})
// 保存到本地存储
saveToLocalStorage()
console.log('成功拖拽到左侧:', updatedItem)
} catch (err) {
console.error('拖拽到左侧发生错误:', err)
} finally {
// 在处理完成后清除当前拖拽信息,但保留最后拖拽信息
setTimeout(() => {
isDraggingFromRight.value = false
currentDragItem.value = null
isDraggingOver.value = false
}, 100)
}
}
// 拖拽结束处理,注意不要立即清除所有状态
const handleDragEnd = () => {
console.log('拖拽结束')
// 延迟清除状态,确保drop事件有时间处理
setTimeout(() => {
isDraggingFromLeft.value = false
isDraggingFromRight.value = false
isDraggingOver.value = false
dragSourceTable.value = null
// 延迟更长时间后再清除lastDragItem,以确保drop事件能够访问
setTimeout(() => {
lastDragItem.value = null
lastDragSource.value = null
}, 500)
}, 200)
}
// 保存数据到本地存储
const saveToLocalStorage = () => {
localStorage.setItem('drag-demo-left', JSON.stringify(leftData.value))
localStorage.setItem('drag-demo-right', JSON.stringify(rightData.value))
localStorage.setItem('drag-demo-history', JSON.stringify(dragHistory.value))
}
// 从本地存储加载数据
const loadFromLocalStorage = () => {
const savedLeft = localStorage.getItem('drag-demo-left')
const savedRight = localStorage.getItem('drag-demo-right')
const savedHistory = localStorage.getItem('drag-demo-history')
if (savedLeft) leftData.value = JSON.parse(savedLeft)
if (savedRight) rightData.value = JSON.parse(savedRight)
if (savedHistory) dragHistory.value = JSON.parse(savedHistory)
}
// 清除历史记录
const clearHistory = () => {
dragHistory.value = []
localStorage.removeItem('drag-demo-history')
}
// 组件挂载时,从本地存储加载数据
onMounted(() => {
loadFromLocalStorage()
})
</script>
<style scoped>
.drag-demo {
padding: 20px;
max-width: 1000px;
margin: 0 auto;
}
.instructions {
margin-bottom: 20px;
padding: 10px;
background: #f8f8f8;
border-radius: 4px;
color: #555;
}
.task-cell {
display: flex;
justify-content: space-between;
align-items: center;
cursor: move;
padding: 6px 4px;
border-radius: 4px;
transition: background 0.2s;
}
.drag-icon {
opacity: 0.5;
transition: opacity 0.2s;
}
.task-cell:hover {
background: #f0f0f0;
}
.task-cell:hover .drag-icon {
opacity: 1;
}
.table-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin-bottom: 30px;
}
.table-section {
border: 1px solid #eaeaea;
border-radius: 8px;
padding: 15px;
background: #fafafa;
}
.table-section h3 {
margin-top: 0;
margin-bottom: 15px;
color: #333;
font-size: 16px;
}
.left-table {
border: 1px solid #e1f5fe;
}
.right-table {
border: 1px solid #e8f5e9;
}
.drop-zone {
padding: 2px;
border-radius: 4px;
transition: background 0.3s, border 0.3s;
min-height: 100px;
}
.active-zone {
background: rgba(0, 100, 255, 0.1);
box-shadow: 0 0 0 2px rgba(0, 100, 255, 0.3);
border: 2px dashed #3388ff;
}
.drag-info {
background: #f5f5f5;
border-radius: 8px;
padding: 15px;
}
.history ul {
padding-left: 20px;
margin: 10px 0;
}
.history li {
margin-bottom: 5px;
color: #555;
}
.time-stamp {
margin-left: 8px;
font-size: 0.8em;
color: #999;
}
.clear-btn {
padding: 6px 12px;
background: #f44336;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 12px;
margin-top: 10px;
}
.clear-btn:hover {
background: #d32f2f;
}
.debug-toggle {
position: fixed;
right: 20px;
bottom: 20px;
background: #333;
color: white;
border: none;
padding: 8px 12px;
border-radius: 4px;
cursor: pointer;
z-index: 100;
}
.debug-panel {
position: fixed;
right: 20px;
bottom: 60px;
width: 400px;
max-height: 600px;
overflow: auto;
background: #f8f8f8;
border: 1px solid #ddd;
padding: 15px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
z-index: 100;
}
.debug-content {
font-size: 12px;
}
.debug-content pre {
white-space: pre-wrap;
background: #eee;
padding: 8px;
border-radius: 4px;
}
</style>
📚代码测试
运行正常
📚测试代码正常跑通,附其他基本代码
-
添加路由
-
页面展示入口
📘编写路由 src\router\index.js

javascript
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')
},
{
path: '/modal',
name: 'modal',
component: () => import('../views/ModalView.vue')
},
{
path: '/richTextEditor',
name: 'richTextEditor',
component: () => import('../views/RichTextEditorView.vue')
},
{
path: '/timePickerView',
name: 'timePickerView',
component: () => import('../views/TimePickerView.vue')
},
{
path: '/multistepForm',
name: 'multistepForm',
component: () => import('../views/MultistepFormView.vue')
},
{
path: '/table1',
name: 'table1',
component: () => import('../views/TableView1.vue')
},
{
path: '/table2',
name: 'table2',
component: () => import('../views/TableView2.vue')
},
{
path: '/table3',
name: 'table3',
component: () => import('../views/TableView3.vue')
},
{
path: '/table4',
name: 'table4',
component: () => import('../views/TableView4.vue')
},
{
path: '/table5',
name: 'table5',
component: () => import('../views/TableView5.vue')
},
{
path: '/table6',
name: 'table6',
component: () => import('../views/TableView6.vue')
},
{
path: '/table7',
name: 'table7',
component: () => import('../views/TableView7.vue')
},
{
path: '/table8',
name: 'table8',
component: () => import('../views/TableView8.vue')
},
{
path: '/table9',
name: 'table9',
component: () => import('../views/TableView9.vue')
},
{
path: '/table10',
name: 'table10',
component: () => import('../views/TableView10.vue')
},
{
path: '/table11',
name: 'table11',
component: () => import('../views/TableView11.vue')
},
{
path: '/table12',
name: 'table12',
component: () => import('../views/TableView12.vue')
},
{
path: '/table12_02',
name: 'table12_02',
component: () => import('../views/TableView12_02.vue')
},
{
path: '/table14',
name: 'table14',
component: () => import('../views/TableView14.vue')
},
{
path: '/table14_01',
name: 'table14_01',
component: () => import('../views/TableView14_01.vue')
},
{
path: '/table14_02',
name: 'table14_02',
component: () => import('../views/TableView14_02.vue')
},
{
path: '/table14_03',
name: 'table14_03',
component: () => import('../views/TableView14_03.vue')
},
{
path: '/table14_04',
name: 'table14_04',
component: () => import('../views/TableView14_04.vue')
},
{
path: '/table14_05',
name: 'table14_05',
component: () => import('../views/TableView14_05.vue')
},
{
path: '/table14_06',
name: 'table14_06',
component: () => import('../views/TableView14_06.vue')
},
{
path: '/table14_07',
name: 'table14_07',
component: () => import('../views/TableView14_07.vue')
},
{
path: '/table14_08',
name: 'table14_08',
component: () => import('../views/TableView14_08.vue')
},
{
path: '/table14_09',
name: 'table14_09',
component: () => import('../views/TableView14_09.vue')
},
{
path: '/table14_10',
name: 'table14_10',
component: () => import('../views/TableView14_10.vue')
},
{
path: '/table14_11',
name: 'table14_11',
component: () => import('../views/TableView14_11.vue')
},
{
path: '/table14_12',
name: 'table14_12',
component: () => import('../views/TableView14_12.vue')
},
{
path: '/table14_13',
name: 'table14_13',
component: () => import('../views/TableView14_13.vue')
},
{
path: '/table14_14',
name: 'table14_14',
component: () => import('../views/TableView14_14.vue')
},
{
path: '/table15',
name: 'table15',
component: () => import('../views/TableView15.vue')
},
{
path: '/table15_01',
name: 'table15_01',
component: () => import('../views/TableView15_01.vue')
},
{
path: '/table15_02',
name: 'table15_02',
component: () => import('../views/TableView15_02.vue')
},
{
path: '/table15_03',
name: 'table15_03',
component: () => import('../views/TableView15_03.vue')
},
{
path: '/table15_04',
name: 'table15_04',
component: () => import('../views/TableView15_04.vue')
},
{
path: '/table15_05',
name: 'table15_05',
component: () => import('../views/TableView15_05.vue')
},
{
path: '/table15_06',
name: 'table15_06',
component: () => import('../views/TableView15_06.vue')
},
{
path: '/table15_07',
name: 'table15_07',
component: () => import('../views/TableView15_07.vue')
},
{
path: '/table15_08',
name: 'table15_08',
component: () => import('../views/TableView15_08.vue')
},
{
path: '/table15_09',
name: 'table15_09',
component: () => import('../views/TableView15_09.vue')
},
{
path: '/table15_10',
name: 'table15_10',
component: () => import('../views/TableView15_10.vue')
},
{
path: '/table15_11',
name: 'table15_11',
component: () => import('../views/TableView15_11.vue')
},
{
path: '/table15_12',
name: 'table15_12',
component: () => import('../views/TableView15_12.vue')
},
{
path: '/table15_13',
name: 'table15_13',
component: () => import('../views/TableView15_13.vue')
},
{
path: '/table15_14',
name: 'table15_14',
component: () => import('../views/TableView15_14.vue')
},
{
path: '/table16',
name: 'table16',
component: () => import('../views/TableView16.vue')
},
{
path: '/table16_01',
name: 'table16_01',
component: () => import('../views/TableView16_01.vue')
},
{
path: '/table16_02',
name: 'table16_02',
component: () => import('../views/TableView16_02.vue')
},
{
path: '/table16_03',
name: 'table16_03',
component: () => import('../views/TableView16_03.vue')
},
{
path: '/table16_04',
name: 'table16_04',
component: () => import('../views/TableView16_04.vue')
}
],
})
export default router
📘编写展示入口 src\App.vue

html
<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>
<RouterLink to="/modal">Modal</RouterLink>
<RouterLink to="/richTextEditor">RichTextEditor</RouterLink>
<RouterLink to="/timePickerView">TimePickerView</RouterLink>
<RouterLink to="/multistepForm">MultistepFormView</RouterLink>
<RouterLink to="/table1">Table1</RouterLink>
<RouterLink to="/table2">Table2</RouterLink>
<RouterLink to="/table3">Table3</RouterLink>
<RouterLink to="/table4">Table4</RouterLink>
<RouterLink to="/table5">Table5</RouterLink>
<RouterLink to="/table6">Table6空状态</RouterLink>
<RouterLink to="/table7">Table7空状态2</RouterLink>
<RouterLink to="/table8">Table8基础加载状态</RouterLink>
<RouterLink to="/table9">Table9自定义加载文本</RouterLink>
<RouterLink to="/table10">Table10完全自定义加载内容</RouterLink>
<RouterLink to="/table11">Table11加载结合分页</RouterLink>
<RouterLink to="/table12">Table12启用列宽调整</RouterLink>
<RouterLink to="/table12_02">table12_02自定义选择列宽度</RouterLink>
<RouterLink to="/table14">table14 添加表头固定功能</RouterLink>
<RouterLink to="/table14_01">table14_01</RouterLink>
<RouterLink to="/table14_02">table14_02</RouterLink>
<RouterLink to="/table14_03">table14_03</RouterLink>
<RouterLink to="/table14_04">table14_04</RouterLink>
<RouterLink to="/table14_05">table14_05</RouterLink>
<RouterLink to="/table14_06">table14_06</RouterLink>
<RouterLink to="/table14_07">table14_07</RouterLink>
<RouterLink to="/table14_08">table14_08</RouterLink>
<RouterLink to="/table14_09">table14_09</RouterLink>
<RouterLink to="/table14_10">table14_10</RouterLink>
<RouterLink to="/table14_11">table14_11</RouterLink>
<RouterLink to="/table14_12">table14_12</RouterLink>
<RouterLink to="/table14_13">table14_13</RouterLink>
<RouterLink to="/table14_14">table14_14</RouterLink>
<RouterLink to="/table15">table15 导出数据功能</RouterLink>
<RouterLink to="/table15_01">table15_01</RouterLink>
<RouterLink to="/table15_02">table15_02</RouterLink>
<RouterLink to="/table15_03">table15_03</RouterLink>
<RouterLink to="/table15_04">table15_04</RouterLink>
<RouterLink to="/table15_05">table15_05</RouterLink>
<RouterLink to="/table15_06">table15_06</RouterLink>
<RouterLink to="/table15_07">table15_07</RouterLink>
<RouterLink to="/table15_08">table15_08</RouterLink>
<RouterLink to="/table15_09">table15_09</RouterLink>
<RouterLink to="/table15_10">table15_10</RouterLink>
<RouterLink to="/table15_11">table15_11</RouterLink>
<RouterLink to="/table15_12">table15_12</RouterLink>
<RouterLink to="/table15_13">table15_13</RouterLink>
<RouterLink to="/table15_14">table15_14</RouterLink>
<RouterLink to="/table16">table16添加行拖拽排序功能</RouterLink>
<RouterLink to="/table16_01">table16_01</RouterLink>
<RouterLink to="/table16_02">table16_02</RouterLink>
<RouterLink to="/table16_03">table16_03</RouterLink>
<RouterLink to="/table16_04">table16_04</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 助力 Vue 开发:打造丝滑的步骤条(Step bar)https://blog.csdn.net/qq_33650655/article/details/145560497
-
DeepSeek 助力 Vue 开发:打造丝滑的进度条(Progress Bar)https://blog.csdn.net/qq_33650655/article/details/145577034
-
DeepSeek 助力 Vue 开发:打造丝滑的标签页(Tabs)https://blog.csdn.net/qq_33650655/article/details/145587999
-
DeepSeek 助力 Vue 开发:打造丝滑的折叠面板(Accordion)https://blog.csdn.net/qq_33650655/article/details/145590404
-
DeepSeek 助力 Vue 开发:打造丝滑的时间线(Timeline )https://blog.csdn.net/qq_33650655/article/details/145597372
-
DeepSeek 助力 Vue 开发:打造丝滑的卡片(Card)https://blog.csdn.net/qq_33650655/article/details/145634564
-
DeepSeek 助力 Vue 开发:打造丝滑的开关切换(Switch)https://blog.csdn.net/qq_33650655/article/details/145644151
-
DeepSeek 助力 Vue 开发:打造丝滑的侧边栏(Sidebar)https://blog.csdn.net/qq_33650655/article/details/145654204
-
DeepSeek 助力 Vue 开发:打造丝滑的评分组件(Rating)https://blog.csdn.net/qq_33650655/article/details/145664576
-
DeepSeek 助力 Vue 开发:打造丝滑的导航栏(Navbar)https://blog.csdn.net/qq_33650655/article/details/145732421
-
DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)https://blog.csdn.net/qq_33650655/article/details/145797928
-
DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)https://blog.csdn.net/qq_33650655/article/details/145817161
-
DeepSeek 助力 Vue 开发:打造丝滑的文本输入框(Text Input)https://blog.csdn.net/qq_33650655/article/details/145837003
-
DeepSeek 助力 Vue 开发:打造丝滑的分割线(Divider)https://blog.csdn.net/qq_33650655/article/details/145849100
-
DeepSeek 助力 Vue 开发:打造丝滑的 复选框(Checkbox)https://blog.csdn.net/qq_33650655/article/details/145855695
-
DeepSeek 助力 Vue3 开发:打造丝滑的标签输入(Tag Input)https://blog.csdn.net/qq_33650655/article/details/145858574
-
DeepSeek 助力 Vue3 开发:打造丝滑的列表(List)https://blog.csdn.net/qq_33650655/article/details/145866384
-
DeepSeek 助力 Vue3 开发:打造丝滑的页眉(Header)https://blog.csdn.net/qq_33650655/article/details/145885122
-
DeepSeek 助力 Vue3 开发:打造丝滑的页脚(Footer)https://blog.csdn.net/qq_33650655/article/details/145886306
-
DeepSeek 助力 Vue3 开发:打造丝滑的分页(Pagination)https://blog.csdn.net/qq_33650655/article/details/145886824
-
DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)https://blog.csdn.net/qq_33650655/article/details/145938677
-
DeepSeek 助力 Vue3 开发:打造丝滑的模态框(Modal)https://blog.csdn.net/qq_33650655/article/details/145938939
到此这篇文章就介绍到这了,更多精彩内容请关注本人以前的文章或继续浏览下面的文章,创作不易,如果能帮助到大家,希望大家多多支持宝码香车~💕,若转载本文,一定注明本文链接。

更多专栏订阅推荐:
💕 vue
✈️ Electron
⭐️ js
📝 字符串