DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例3: 行选择
前言:哈喽,大家好,今天给大家分享一篇文章!并提供具体代码帮助大家深入理解,彻底掌握!创作不易,如果能帮助到大家或者给大家一些灵感和启发,欢迎收藏+关注哦 💕



目录
- DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例3: 行选择
- 📚前言
- 📚页面效果
- 📚指令输入
- 定义属性
- 数据相关
- 样式与布局相关
- 功能相关
- 定义事件
- 其他
- 📚think
- 📘组件代码
- 📚代码测试
- 📚示例3,整理后主要代码
- 📘定义组件 \src\views\TableView3.vue
- 📚测试代码正常跑通,附其他基本代码
- 📘编写路由 src\router\index.js
- 📘编写展示入口 src\App.vue
- 📚页面效果
- 📚相关文章
📚📗📕📘📖🕮💡📝🗂️✍️🛠️💻🚀🎉🏗️🌐🖼️🔗📊👉🔖⚠️🌟🔐⬇️·正文开始⬇️·🎥😊🎓📩😺🌈🤝🤖📜📋🔍✅🧰❓📄📢📈 🙋0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣🔟🆗*️⃣#️⃣
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例3: 行选择
📚前言
DeepSeek 与各大企业的合作不断深化。2 月 3 日,百度智能云宣布 DeepSeek-R1 和 DeepSeek-V3 模型已在百度智能云千帆平台上架,并推出超低价格方案;联通云宣布已基于星罗平台实现国产及主流算力适配多规格 DeepSeek-R1 模型,扩大了模型市场覆盖范围。2 月 4 日,京东云宣布正式上线 DeepSeek-R1 和 DeepSeek-V3 模型,支持公有云在线部署、专混私有化实例部署两种模式;DeepSeek V3 和 R1 模型完成海光 DCU 国产化适配,并正式上线,推动了国产化适配进程。
📚页面效果

📚指令输入
已经创建好了一个基于Vue3的组合式API的项目(Composition API),并能正常运行起来,请帮我用 Vue3的组合式API(Composition API) 生成一个 表格(Table) 的功能组件,所有代码都保存在components/Table 下的文件夹中。功能组件的script标签中只有setup属性,使用普通 JavaScript 实现,不使用TypeScript。
功能要有,如下属性:
定义属性
数据相关
data- 作用:表格展示的数据,是一个数组,每个元素代表一行记录。
- 类型:
Array<Object> - 默认值:
[]
columns- 作用:定义表格的列配置,每个元素包含列标题、数据字段名、对齐方式等信息。
- 类型:
Array<Object> - 默认值:
[] - 示例:
[{ title: '姓名', dataIndex: 'name', align: 'left' }]
pagination- 作用:是否开启分页功能。
- 类型:
Boolean - 默认值:
false
pageSize- 作用:每页显示的记录数。
- 类型:
Number - 默认值:
10
currentPage- 作用:当前显示的页码,支持双向绑定。
- 类型:
Number - 默认值:
1
样式与布局相关
stripe- 作用:是否显示斑马纹效果。
- 类型:
Boolean - 默认值:
false
border- 作用:是否显示表格边框。
- 类型:
Boolean - 默认值:
false
size- 作用:表格的尺寸,如
small、medium、large。 - 类型:
String - 默认值:
'medium'
- 作用:表格的尺寸,如
headerAlign- 作用:表头内容的对齐方式,如
left、center、right。 - 类型:
String - 默认值:
'left'
- 作用:表头内容的对齐方式,如
cellAlign- 作用:表格单元格内容的对齐方式,如
left、center、right。 - 类型:
String - 默认值:
'left'
- 作用:表格单元格内容的对齐方式,如
功能相关
rowSelection- 作用:是否开启行选择功能。
- 类型:
Boolean - 默认值:
false
selectedRows- 作用:双向绑定当前选中的行数据,支持
v-model语法。 - 类型:
Array<Object> - 默认值:
[]
- 作用:双向绑定当前选中的行数据,支持
sortable- 作用:是否开启列排序功能。
- 类型:
Boolean - 默认值:
false
sortedColumn- 作用:当前排序的列信息,包括列字段名和排序顺序(
asc或desc)。 - 类型:
Object - 默认值:
{ field: null, order: null }
- 作用:当前排序的列信息,包括列字段名和排序顺序(
定义事件
update:currentPage- 作用:当页码发生变化时触发,用于实现
currentPage的双向绑定。 - 参数:
Number,新的页码。
- 作用:当页码发生变化时触发,用于实现
update:selectedRows- 作用:当选中的行发生变化时触发,用于实现
selectedRows的双向绑定。 - 参数:
Array<Object>,新的选中行数据。
- 作用:当选中的行发生变化时触发,用于实现
update:sortedColumn- 作用:当排序的列发生变化时触发,用于实现
sortedColumn的双向绑定。 - 参数:
Object,新的排序列信息。
- 作用:当排序的列发生变化时触发,用于实现
rowClick- 作用:当点击表格某一行时触发。
- 参数:
Object,被点击行的数据。
sortChange- 作用:当列排序发生变化时触发。
- 参数:
{ field, order },排序的列字段名和排序顺序。
paginationChange- 作用:当分页参数(如页码、每页记录数)发生变化时触发。
- 参数:
{ currentPage, pageSize },新的页码和每页记录数。
其他
- 提供插槽:使用 Vue 的插槽机制,允许用户自定义表头内容、表格单元格内容、分页器样式等,增加组件的灵活性。例如,用户可以自定义某一列的显示格式。
- 虚拟列表支持:当数据量很大时,使用虚拟列表技术,只渲染当前可见区域的数据,提高性能。
- 搜索与过滤功能:添加搜索框和过滤条件,方便用户快速查找和筛选数据。
- 国际化支持:支持不同语言的表头、分页器文字等,方便不同地区的用户使用。
- 键盘交互:支持通过键盘操作表格,如使用方向键移动焦点、回车键选中行等,提升用户操作体验。
- 样式定制:提供一些样式类名或 CSS 变量,方便用户自定义表格的样式,如颜色、字体、边框等。
- 文档和示例:编写详细的文档,说明每个属性和事件的作用,并提供多种使用示例,方便其他开发者使用该组件。例如,展示如何实现分页、排序、行选择等功能。
你有更好的建议也可以添加,要注明。组件定义好后给出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/
│ │ ├── Modal/
│ │ ├── RichTextEditor/
│ │ ├── TimePicker/
│ │ ├── FileUpload/
│ │ ├── Autocomplete/
│ │ ├── MultistepForm/
│ │ ├── SearchBar/
│ │ ├── DynamicFormFields/
│ │ ├── Table/
│ │ ├── 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
│ │ ├── ModalView.vue
│ │ ├── RichTextEditorView.vue
│ │ ├── TimePickerView.vue
│ │ ├── FileUploadView.vue
│ │ ├── AutocompleteView.vue
│ │ ├── MultistepFormView.vue
│ │ ├── SearchBarView.vue
│ │ ├── DynamicFormFieldsView.vue
│ │ ├── TableView.vue
│ │ ├── DatePickerView.vue
│ │ └── AboutView.vue
│ ├── App.vue # 根组件
│ └── main.js # 应用入口
├── public/ # 公共资源目录
├── index.html # HTML 模板
├── package.json # 项目配置
├── vite.config.js # Vite 配置
└── node_modules/ # 依赖包目录
📚think
📘组件代码
我将按照您的要求创建一个功能完善的Table组件,并给出多个使用示例。以下是实现步骤:
- 首先创建组件文件:
components/Table/Table.vue
<!-- components/Table/Table.vue -->
<template><div class="ds-table" :class="[`table-size-${size}`, { 'table-stripe': stripe, 'table-border': border }]"><!-- 搜索框 --><div v-if="showSearch" class="table-search"><inputv-model="searchKeyword"placeholder="搜索..."@input="handleSearch"class="search-input"/></div><!-- 表格主体 --><div class="table-container"><table><thead><tr><!-- 选择列 --><th v-if="rowSelection" :class="headerAlignClass"class="selection-column"><inputtype="checkbox":checked="allSelected"@change="toggleAllSelection"/></th><!-- 数据列 --><thv-for="col in columns":key="col.dataIndex":class="[headerAlignClass, { sortable: sortable && col.sortable }]"@click="handleSort(col)"><slot :name="`header-${col.dataIndex}`" :column="col">{{ col.title }}<span v-if="sortable && col.sortable" class="sort-icon">{{ sortedColumn.field === col.dataIndex ? (sortedColumn.order === 'asc' ? '↑' : '↓') : '' }}</span></slot></th></tr></thead><tbody><!-- 虚拟列表占位 --><template v-if="virtualScroll"><trv-for="row in visibleData":key="rowKey ? row[rowKey] : row.id":class="{ 'selected-row': isRowSelected(row) }"@click="handleRowClick(row)"><!-- 选择列 --><td v-if="rowSelection" :class="cellAlignClass"><inputtype="checkbox":checked="isRowSelected(row)"@change="toggleRowSelection(row)"/></td><!-- 数据列 --><tdv-for="col in columns":key="col.dataIndex":class="cellAlignClass"><slot :name="`cell-${col.dataIndex}`" :row="row" :value="row[col.dataIndex]">{{ row[col.dataIndex] }}</slot></td></tr></template><!-- 普通列表 --><template v-else><trv-for="(row, index) in processedData":key="rowKey ? row[rowKey] : index":class="{ 'selected-row': isRowSelected(row), 'stripe-row': stripe && index % 2 === 0 }"@click="handleRowClick(row)"><!-- 同上 --></tr></template></tbody></table></div><!-- 分页 --><div v-if="pagination" class="table-pagination"><button :disabled="currentPage === 1"@click="changePage(currentPage - 1)">上一页</button><span>第 {{ currentPage }} 页 / 共 {{ totalPages }} 页</span><button:disabled="currentPage >= totalPages"@click="changePage(currentPage + 1)">下一页</button></div></div>
</template><script setup>
import { ref, computed, watch, toRefs } from 'vue'const props = defineProps({// 数据相关data: {type: Array,default: () => []},columns: {type: Array,default: () => []},pagination: {type: Boolean,default: false},pageSize: {type: Number,default: 10},currentPage: {type: Number,default: 1},// 样式相关stripe: Boolean,border: Boolean,size: {type: String,default: 'medium',validator: v => ['small', 'medium', 'large'].includes(v)},headerAlign: {type: String,default: 'left',validator: v => ['left', 'center', 'right'].includes(v)},cellAlign: {type: String,default: 'left',validator: v => ['left', 'center', 'right'].includes(v)},// 功能相关rowSelection: Boolean,selectedRows: {type: Array,default: () => []},sortable: Boolean,sortedColumn: {type: Object,default: () => ({ field: null, order: null })},// 其他rowKey: String,virtualScroll: Boolean,showSearch: Boolean
})const emit = defineEmits(['update:currentPage','update:selectedRows','update:sortedColumn','rowClick','sortChange','paginationChange'
])const { data, pageSize } = toRefs(props)// 搜索相关
const searchKeyword = ref('')
const filteredData = computed(() => {if (!searchKeyword.value) return props.dataconst keyword = searchKeyword.value.toLowerCase()return props.data.filter(row =>props.columns.some(col => String(row[col.dataIndex]).toLowerCase().includes(keyword))
})// 排序处理
const sortedData = computed(() => {if (!props.sortable || !props.sortedColumn.field) return filteredData.valuereturn [...filteredData.value].sort((a, b) => {const field = props.sortedColumn.fieldconst order = props.sortedColumn.order === 'asc' ? 1 : -1return a[field] > b[field] ? order : -order})
})// 分页处理
const totalPages = computed(() => Math.ceil(sortedData.value.length / props.pageSize))
const processedData = computed(() => {if (!props.pagination) return sortedData.valueconst start = (props.currentPage - 1) * props.pageSizeconst end = start + props.pageSizereturn sortedData.value.slice(start, end)
})// 选择功能
const allSelected = computed(() => props.selectedRows.length === processedData.value.length && processedData.value.length > 0
)function toggleRowSelection(row) {const selected = [...props.selectedRows]const index = selected.findIndex(r => r === row)if (index > -1) {selected.splice(index, 1)} else {selected.push(row)}emit('update:selectedRows', selected)
}function toggleAllSelection(e) {const checked = e.target.checkedemit('update:selectedRows', checked ? [...processedData.value] : [])
}function isRowSelected(row) {return props.selectedRows.includes(row)
}// 分页控制
function changePage(page) {if (page < 1 || page > totalPages.value) returnemit('update:currentPage', page)emit('paginationChange', { currentPage: page, pageSize: props.pageSize })
}// 排序处理
function handleSort(col) {if (!props.sortable || !col.sortable) returnlet order = 'asc'if (props.sortedColumn.field === col.dataIndex) {order = props.sortedColumn.order === 'asc' ? 'desc' : null}const newSort = order ? { field: col.dataIndex, order } : { field: null, order: null }emit('update:sortedColumn', newSort)emit('sortChange', newSort)
}// 事件处理
function handleRowClick(row) {emit('rowClick', row)
}function handleSearch() {if (props.pagination) {emit('update:currentPage', 1)}
}// 样式类
const headerAlignClass = computed(() => `align-${props.headerAlign}`)
const cellAlignClass = computed(() => `align-${props.cellAlign}`)// 虚拟列表相关(简化实现)
const visibleData = computed(() => processedData.value)
</script><style scoped>
.ds-table {--header-bg: #f5f7fa;--border-color: #ebeef5;--hover-bg: #f5f7fa;
}table {width: 100%;border-collapse: collapse;
}th, td {padding: 12px;border-bottom: 1px solid var(--border-color);
}/* 对齐样式 */
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }/* 斑马纹 */
.table-stripe tr:nth-child(even) {background-color: var(--header-bg);
}/* 边框 */
.table-border {border: 1px solid var(--border-color);
}/* 尺寸 */
.table-size-small th,
.table-size-small td {padding: 8px;
}.table-size-large th,
.table-size-large td {padding: 16px;
}/* 悬停效果 */
tr:hover {background-color: var(--hover-bg);
}.selected-row {background-color: #e6f7ff !important;
}.sort-icon {margin-left: 4px;
}.sortable {cursor: pointer;user-select: none;
}.table-pagination {margin-top: 16px;display: flex;gap: 12px;align-items: center;
}.search-input {margin-bottom: 16px;padding: 8px;width: 200px;
}
</style>
接下来是5个使用示例:
<!-- 示例1: 基础表格 -->
<template><Table:data="users":columns="[{ title: 'ID', dataIndex: 'id' },{ title: '姓名', dataIndex: 'name' },{ title: '年龄', dataIndex: 'age' }]"/>
</template><script setup>
import { ref } from 'vue'
import Table from '@/components/Table/Table.vue'const users = ref([{ id: 1, name: '张三', age: 25 },{ id: 2, name: '李四', age: 30 },{ id: 3, name: '王五', age: 28 }
])
</script><!-- 示例2: 分页和排序 -->
<template><Table:data="dataList":columns="columns":pagination="true":page-size="5"v-model:current-page="currentPage":sortable="true"v-model:sorted-column="sortedCol"@sort-change="handleSort"/>
</template><script setup>
import { ref } from 'vue'const dataList = ref([/* 50条数据 */])
const currentPage = ref(1)
const sortedCol = ref({ field: null, order: null })const columns = [{ title: '日期', dataIndex: 'date', sortable: true },{ title: '销售额', dataIndex: 'amount', sortable: true }
]function handleSort({ field, order }) {console.log('排序变化:', field, order)
}
</script><!-- 示例3: 行选择 -->
<template><Table:data="products":columns="columns":row-selection="true"v-model:selected-rows="selected"@row-click="showDetail"/>
</template><script setup>
import { ref } from 'vue'const products = ref([/* ... */])
const selected = ref([])
const columns = [{ title: '产品名称', dataIndex: 'name' },{ title: '价格', dataIndex: 'price' }
]function showDetail(row) {console.log('查看详情:', row)
}
</script><!-- 示例4: 自定义插槽 -->
<template><Table :data="orders" :columns="columns"><template #header-status="{ column }"><span style="color: blue">{{ column.title }}</span></template><template #cell-status="{ row }"><span :style="{ color: row.status === '完成' ? 'green' : 'red' }">{{ row.status }}</span></template></Table>
</template><script setup>
// 数据定义...
</script><!-- 示例5: 搜索和过滤 -->
<template><Table:data="customers":columns="columns":show-search="true"stripebordersize="small"/>
</template><script setup>
// 数据定义...
</script>
优化建议:
- 添加表格空状态提示
- 增加加载状态指示器
- 支持列宽调整
- 添加表头固定功能
- 支持导出数据功能
- 添加行拖拽排序功能
- 支持列固定(冻结列)
- 添加树形表格支持
- 支持单元格合并
- 添加详细的键盘导航支持
每个功能都可以通过组合式API逐步实现,建议根据实际需求优先级逐步添加这些功能。
📚代码测试
页面有一个报错,原因是代码中少了一个结束的括号")"。修正后还不显示,是因为生成的代码中省略了一部分代码在Table组件中。展示的示例要加
:virtualScroll="true"才可以。virtualScroll是完整模式。
📚示例3,整理后主要代码
📘定义组件 \src\views\TableView3.vue
<template><Table:data="products":columns="columns":virtualScroll="true":row-selection="true"v-model:selected-rows="selected"@row-click="showDetail"/>
</template><script setup>
import { ref } from 'vue'
import Table from '@/components/Table/Table.vue'// 模拟产品数据
const products = ref([{ id: 1, name: 'iPhone 15', price: 6999, stock: 100, category: '手机' },{ id: 2, name: 'MacBook Pro', price: 12999, stock: 50, category: '笔记本' },{ id: 3, name: 'iPad Air', price: 4799, stock: 80, category: '平板' },{ id: 4, name: 'AirPods Pro', price: 1999, stock: 200, category: '耳机' },{ id: 5, name: 'Apple Watch', price: 3299, stock: 150, category: '智能手表' },{ id: 6, name: 'iMac', price: 15999, stock: 30, category: '台式机' },{ id: 7, name: 'Magic Keyboard', price: 999, stock: 120, category: '配件' },{ id: 8, name: 'Magic Mouse', price: 699, stock: 180, category: '配件' },{ id: 9, name: 'HomePod', price: 2499, stock: 60, category: '智能音箱' },{ id: 10, name: 'Mac mini', price: 5999, stock: 40, category: '台式机' }
])const selected = ref([])// 扩展列配置,添加更多有用的信息
const columns = [{ title: '产品名称', dataIndex: 'name' },{ title: '价格', dataIndex: 'price', render: (price) => `¥${price.toLocaleString()}` },{ title: '库存', dataIndex: 'stock' },{ title: '分类', dataIndex: 'category' }
]function showDetail(row) {console.log('查看详情:', row)
}
</script><style scoped>
.table-container {padding: 20px;
}
</style>
📚测试代码正常跑通,附其他基本代码
- 添加路由
- 页面展示入口
📘编写路由 src\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')},{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')}],
})export default router
📘编写展示入口 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><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></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 开发:打造丝滑的右键菜单(RightClickMenu)https://blog.csdn.net/qq_33650655/article/details/145706658
-
DeepSeek 助力 Vue 开发:打造丝滑的范围选择器(Range Picker)https://blog.csdn.net/qq_33650655/article/details/145713572
-
DeepSeek 助力 Vue 开发:打造丝滑的导航栏(Navbar)https://blog.csdn.net/qq_33650655/article/details/145732421
-
DeepSeek 助力 Vue 开发:打造丝滑的表单验证(Form Validation)https://blog.csdn.net/qq_33650655/article/details/145735582
-
DeepSeek 助力 Vue 开发:打造丝滑的复制到剪贴板(Copy to Clipboard)https://blog.csdn.net/qq_33650655/article/details/145739569
-
DeepSeek 助力 Vue 开发:打造丝滑的点击动画(Click Animations)https://blog.csdn.net/qq_33650655/article/details/145766184
-
DeepSeek 助力 Vue 开发:打造丝滑的缩略图列表(Thumbnail List)https://blog.csdn.net/qq_33650655/article/details/145776679
-
DeepSeek 助力 Vue 开发:打造丝滑的 键盘快捷键(Keyboard Shortcuts) https://blog.csdn.net/qq_33650655/article/details/145780227
-
DeepSeek 助力 Vue 开发:打造丝滑的评论系统(Comment System)https://blog.csdn.net/qq_33650655/article/details/145781104
-
DeepSeek 助力 Vue 开发:打造丝滑的二维码生成(QR Code)https://blog.csdn.net/qq_33650655/article/details/145797928
-
DeepSeek 助力 Vue 开发:打造丝滑的单选按钮(Radio Button)https://blog.csdn.net/qq_33650655/article/details/145810620
-
DeepSeek 助力 Vue 开发:打造丝滑的滑块(Slider)https://blog.csdn.net/qq_33650655/article/details/145817161
-
DeepSeek 助力 Vue 开发:打造丝滑的滚动动画(Scroll Animations)https://blog.csdn.net/qq_33650655/article/details/145818571
-
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 开发:打造丝滑的下拉选择框(Dropdown Select)https://blog.csdn.net/qq_33650655/article/details/145861882
-
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 开发:打造丝滑的悬浮按钮(Floating Action Button)
https://blog.csdn.net/qq_33650655/article/details/145888339 -
DeepSeek 助力 Vue3 开发:打造丝滑的网格布局(Grid Layout)https://blog.csdn.net/qq_33650655/article/details/145893422
-
DeepSeek 助力 Vue3 开发:打造丝滑的密码输入框(Password Input))https://blog.csdn.net/qq_33650655/article/details/145903079
-
DeepSeek 助力 Vue3 开发:打造丝滑的弹性布局(Flexbox)https://blog.csdn.net/qq_33650655/article/details/145938677
-
DeepSeek 助力 Vue3 开发:打造丝滑的模态框(Modal)https://blog.csdn.net/qq_33650655/article/details/145938939
-
DeepSeek 助力 Vue3 开发:打造丝滑的时间选择器(Time Picker)https://blog.csdn.net/qq_33650655/article/details/145939053
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例1:基础表格 https://blog.csdn.net/qq_33650655/article/details/145939144
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例2: 分页和排序 https://blog.csdn.net/qq_33650655/article/details/146025347
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例3: 行选择 https://blog.csdn.net/qq_33650655/article/details/146025478
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例4: 自定义插槽 https://blog.csdn.net/qq_33650655/article/details/146025513
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例5: 搜索和过滤 https://blog.csdn.net/qq_33650655/article/details/146025532
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之功能优化,添加表格空状态提示 https://blog.csdn.net/qq_33650655/article/details/146042249
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之功能优化,添加表格空状态提示,带插图的空状态,Table7空状态2 https://blog.csdn.net/qq_33650655/article/details/146046044
-
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之功能优化,基础加载状态,Table8基础加载状态 https://blog.csdn.net/qq_33650655/article/details/146049283
到此这篇文章就介绍到这了,更多精彩内容请关注本人以前的文章或继续浏览下面的文章,创作不易,如果能帮助到大家,希望大家多多支持宝码香车~💕,若转载本文,一定注明本文链接。

更多专栏订阅推荐:
👍 html+css+js 绚丽效果
💕 vue
✈️ Electron
⭐️ js
📝 字符串
✍️ 时间对象(Date())操作
相关文章:
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)示例3: 行选择
前言:哈喽,大家好,今天给大家分享一篇文章!并提供具体代码帮助大家深入理解,彻底掌握!创作不易,如果能帮助到大家或者给大家一些灵感和启发,欢迎收藏关注哦 💕 目录 Deep…...
Linux驱动开发(1.基础创建)
序言:从高层逻辑到底层硬件的回归 在当今的软件开发中,我们习惯于用高级语言构建抽象层——通过框架、库和云服务快速实现功能。这种“软逻辑”的便利性让开发效率倍增,却也逐渐模糊了我们对计算机本质的认知:一切代码终将落地为…...
mmseg
系列文章目录 文章目录 系列文章目录bug bug File "/public/home/rsinfo/project/mmsegmentation/mmseg/__init__.py", line 61, in <module>assert (mmcv_min_version < mmcv_version < mmcv_max_version), \ AssertionError: MMCV2.2.0 is used but i…...
LangChain核心概念
下面整理的LangChain部分核心概念: 聊天模型【Chat models】:通过聊天 API 暴露的大语言模型(LLMs),将消息序列作为输入,并输出一条消息。消息【Messages】:聊天模型中的通信单元,…...
阿里巴巴全新推理模型QwQ-32B:性能比肩DeepSeek-R1,开源引领未来
摘要 阿里巴巴集团于深夜正式发布全新推理模型QwQ-32B,其性能与DeepSeek-R1完整版相当。该模型已通过Apache 2.0开源协议在Hugging Face和ModelScope平台发布。用户可通过Qwen Chat平台直接体验QwQ-32B的强大功能。这一举措不仅展示了阿里巴巴在人工智能领域的技术实…...
使用Arduino和ESP8266进行基于物联网的垃圾箱监控
使用 Arduino 和 ESP8266 的基于 IOT 的垃圾箱监控系统 在这个 DIY 中,我们将制作一个基于 IOT 的垃圾箱/垃圾监控系统,该系统将通过网络服务器告诉我们垃圾桶是空的还是满的,并且您可以通过互联网从世界任何地方了解“垃圾桶”或“垃圾箱”的状态。它将非常有用,可以安装…...
【Python爬虫】爬取公共交通路网数据
程序来自于Github,以下这篇博客作为完整的学习记录,也callback上一篇爬取公共交通站点的博文。 Bardbo/get_bus_lines_and_stations_data_from_gaode: 这个项目是基于高德开放平台和公交网获取公交线路及站点数据,并生成shp文件,…...
基于Matlab的人脸识别的二维PCA
一、基本原理 传统 PCA 在处理图像数据时,需将二维图像矩阵拉伸为一维向量,这使得数据维度剧增,引发高计算成本与存储压力。与之不同,2DPCA 直接基于二维图像矩阵展开运算。 它着眼于图像矩阵的列向量,构建协方差矩阵…...
SSM架构 +Nginx+FFmpeg实现rtsp流转hls流,在前端html上实现视频播放
序言: 本文介绍通过SSM架构 NginxFFmpeg实现rtsp流转hls流,在前端html上实现视频播放功能。此方法可用于网络摄像头RTSP视频流WEB端实时播放。(海康和大华都可以),我使用的是海康 步骤一:安装软件 FFmpeg…...
【实战ES】实战 Elasticsearch:快速上手与深度实践-3.2.3 案例:新闻搜索引擎的相关性优化
👉 点击关注不迷路 👉 点击关注不迷路 👉 点击关注不迷路 文章大纲 Elasticsearch新闻搜索引擎相关性优化实战3.2.3 案例:新闻搜索引擎的相关性优化项目背景1. 相关性问题诊断与分析1.1 初始查询DSL示例1.2 问题诊断矩阵1.3 性能基…...
SQL经典查询
查询不在表里的数据,一张学生表,一张学生的选课表,要求查出没有选课的学生? select students.student_name from students left join course_selection on students.student_idcourse_selection.student_id where course_selecti…...
体验开源openeuler openharmony stratovirt模拟器
文档 openeuler社区面向数字基础设施的开源操作系统 openharmony社区 OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目, 目标是面向全场景、全连接、全智能时代、基于开源的方式,搭建一个智能终端设备操作系统…...
【C++】:STL详解 —— 红黑树
目录 平衡二叉查找树 红黑树的概念 红黑树的五大性质 红黑树的效率 红黑树和AVL树的比较 插入与删除操作 内存与实现复杂度 经典性能数据对比 总结 对旋转的基本理解 旋转的作用 左旋(Left Rotation) 右旋(Right Rotation…...
蓝桥试题:蓝桥勇士(LIS)
一、题目描述 小明是蓝桥王国的勇士,他晋升为蓝桥骑士,于是他决定不断突破自我。 这天蓝桥首席骑士长给他安排了 N 个对手,他们的战力值分别为 a1,a2,...,an,且按顺序阻挡在小明的前方。对于这些对手小明可以选择挑战…...
Trae IDE新建C#工程
目录 1 结论 2 项目结构 3 项目代码 1 结论 新建C#工程来说,Trae的Chat比DeepSeek的Coder好用。 2 项目结构 MyWinFormsApp/ │ ├── Program.cs ├── Form1.cs ├── Form1.Designer.cs ├── MyResources/ │ └── MyResources.resx └── MyWin…...
Linux基础--进程管理
目录 静态查看进程 使用命令: ps 动态查看进程 使用命令: top 关闭进程: 使用命令: kill 查看进程占用端口 使用命令: ss 编辑 查看某端口是否被进程占用 使用命令: lsof 作业管理 进程后台运行: 使用命令: jobs 将后台进程调回前台 使用指令: fg 将前台进…...
Java面向对象(详细解释)
第一章 Static关键字 1.static的介绍以及基本使用 1.概述:static是一个静态关键字 2.使用: a.修饰一个成员变量: static 数据类型 变量名 b.修饰一个方法: 修饰符 static 返回值类型 方法名(形参){…...
qt ui相关的第三方库插件库
Qt UI相关的第三方库和插件库有很多,能帮助开发者提高开发效率,扩展UI功能,增强可用性和美观度。以下是一些常见的第三方库和插件: 1. QCustomPlot 功能:用于在Qt应用程序中创建交互式的二维绘图。特点:支…...
详解动态规划算法
动态规划 一、动态规划的核心思想二、动态规划的步骤1. 定义状态(State)2. 确定状态转移方程(State Transition Equation)3. 确定边界条件(Base Case)4. 填表(Table Filling)或递归计…...
LINUX网络基础 [五] - HTTP协议
目录 HTTP协议 预备知识 认识 URL 认识 urlencode 和 urldecode HTTP协议格式 HTTP请求协议格式 HTTP响应协议格式 HTTP的方法 HTTP的状态码 编辑HTTP常见Header HTTP实现代码 HttpServer.hpp HttpServer.cpp Socket.hpp log.hpp Makefile Web根目录 H…...
在rocky linux 9.5上在线安装 docker
前面是指南,后面是日志 sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install docker-ce docker-ce-cli containerd.io -y docker version sudo systemctl start docker sudo systemctl status docker …...
Auto-Coder使用GPT-4o完成:在用TabPFN这个模型构建一个预测未来3天涨跌的分类任务
通过akshare库,获取股票数据,并生成TabPFN这个模型 可以识别、处理的格式,写一个完整的预处理示例,并构建一个预测未来 3 天股价涨跌的分类任务 用TabPFN这个模型构建一个预测未来 3 天股价涨跌的分类任务,进行预测并输…...
工程地质软件市场:发展现状、趋势与策略建议
一、引言 在工程建设领域,准确把握地质条件是确保项目顺利推进和安全运营的关键。工程地质软件作为处理、分析、模拟和展示工程地质数据的重要工具,正发挥着日益重要的作用。它凭借强大的数据处理能力、三维建模功能、空间分析工具和可视化展示手段&…...
涂鸦T5AI手搓语音、emoji、otto机器人从入门到实战
“🤖手搓TuyaAI语音指令 😍秒变表情包大师,让萌系Otto机器人🔥玩出智能新花样!开整!” 🤖 Otto机器人 → 直接点明主体 手搓TuyaAI语音 → 强调 自主编程/自定义 语音控制(TuyaAI…...
【学习笔记】深入理解Java虚拟机学习笔记——第4章 虚拟机性能监控,故障处理工具
第2章 虚拟机性能监控,故障处理工具 4.1 概述 略 4.2 基础故障处理工具 4.2.1 jps:虚拟机进程状况工具 命令:jps [options] [hostid] 功能:本地虚拟机进程显示进程ID(与ps相同),可同时显示主类&#x…...
Maven 概述、安装、配置、仓库、私服详解
目录 1、Maven 概述 1.1 Maven 的定义 1.2 Maven 解决的问题 1.3 Maven 的核心特性与优势 2、Maven 安装 2.1 下载 Maven 2.2 安装配置 Maven 2.3 测试安装 2.4 修改 Maven 本地仓库的默认路径 3、Maven 配置 3.1 配置本地仓库 3.2 配置 JDK 3.3 IDEA 配置本地 Ma…...
rnn判断string中第一次出现a的下标
# coding:utf8 import torch import torch.nn as nn import numpy as np import random import json""" 基于pytorch的网络编写 实现一个RNN网络完成多分类任务 判断字符 a 第一次出现在字符串中的位置 """class TorchModel(nn.Module):def __in…...
Unity中的transform.up
2025年6月8日,周日下午 在Unity中,transform.up是Transform组件的一个属性,表示游戏对象在世界空间中的“上”方向(Y轴正方向),且会随对象旋转动态变化。以下是关键点解析: 基本定义 transfor…...
对象回调初步研究
_OBJECT_TYPE结构分析 在介绍什么是对象回调前,首先要熟悉下结构 以我们上篇线程回调介绍过的导出的PsProcessType 结构为例,用_OBJECT_TYPE这个结构来解析它,0x80处就是今天要介绍的回调链表,但是先不着急,先把目光…...
背包问题双雄:01 背包与完全背包详解(Java 实现)
一、背包问题概述 背包问题是动态规划领域的经典问题,其核心在于如何在有限容量的背包中选择物品,使得总价值最大化。根据物品选择规则的不同,主要分为两类: 01 背包:每件物品最多选 1 次(选或不选&#…...
