商城后台管理系统 05 商品列表-静态布局

商品列表-静态布局 实现代码如下
复制代码
1, src/views/Goods/Goods.vue

<template>
	<div class="goods">
		<!-- 1,搜索区域 -->
		<div class="header">
			<el-input v-model="input" placeholder="请输入内容"></el-input>
			<el-button type="primary">查询</el-button>
			<el-button type="primary">添加</el-button>
		</div>
		<!-- 2, 表格区域 展示视图数据 -->
		<div class="wrapper">
			<el-table :data="tableData" border @selection-change="handleSelectionChange">
				<el-table-column type="selection" width="55">
				</el-table-column>
				<el-table-column prop="date" label="商品ID" width="100">
				</el-table-column>
				<el-table-column prop="date" label="商品名称" width="100">
				</el-table-column>
				<el-table-column prop="date" label="商品价格" width="100">
				</el-table-column>
				<el-table-column prop="date" label="商品数量" width="100">
				</el-table-column>
				<el-table-column prop="date" label="规格类目" width="100">
				</el-table-column>
				<el-table-column prop="date" label="商品图片">
				</el-table-column>
				<el-table-column prop="date" label="商品卖点">
				</el-table-column>
				<el-table-column prop="date" label="商品描述">
				</el-table-column>
				<el-table-column prop="date" label="操作" width="180">
					<template slot-scope="scope">
						<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
						<el-button size="mini" type="danger"
							@click="handleDelete(scope.$index, scope.row)">删除</el-button>
					</template>
				</el-table-column>
			</el-table>
		</div>

		<!-- 3, 分页展示 -->
		<div class="pagination"></div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				// 声明变量
				input: '',
				tableData: [{
					date: '2016-05-02',
					name: '王小虎',
					address: '上海市普陀区金沙江路 1518 弄'
				}]
			}
		},
		methods: {
			// 编辑操作
			handleEdit(index, row) {
				console.log(index, row);
			},
			// 删除操作
			handleDelete(index, row) {
				console.log(index, row);
			},
			// 选择数据
			handleSelectionChange(val) {
				this.multipleSelection = val;
			}
		}
	}
</script>

<style lang="less" scoped>
	.goods {
		margin: 20px;
	}

	.header {
		display: flex;

		button {
			margin-left: 20px;
		}
	}

	.wrapper {
		margin: 20px 0;
	}
</style>
相关推荐
老毛肚4 小时前
jeecg-boot-base-core 02 day
javascript·python
岁月宁静5 小时前
RAG 文档摄入全链路,从原理到生产落地
vue.js·人工智能·python
#麻辣小龙虾#7 小时前
基于vue3.0开发一款【固废与废气运维管理系统】(支持源码)
前端·vue.js·vue3
一 乐9 小时前
家政服务管理系统|基于springboot + vue家政服务管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·家政服务管理系统
烬羽9 小时前
后端返回的 JSON 字符串,浏览器怎么"看懂"的?——Ajax 全链路拆解
javascript
半个落月10 小时前
一个新手用 Bun + Axios 调通 DeepSeek API 的实践记录
javascript
不好听61310 小时前
深入理解链表:线性数据结构的另一面
javascript·数据结构
林希_Rachel_傻希希10 小时前
学React治好了我的焦虑症,1小时速通React 前20分钟。
前端·javascript·面试
小林ixn10 小时前
从 Ajax 到异步编程:JSON 序列化、Event Loop 与 XHR 请求完全解析
javascript
丷丩11 小时前
MapLibre GL JS第47课:添加动画图标
javascript·gis·动画·mapbox·maplibre