欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 八卦 > 用MySQL+node+vue做一个学生信息管理系统(二):创建MySQL数据表、创建HTML用户列表页面

用MySQL+node+vue做一个学生信息管理系统(二):创建MySQL数据表、创建HTML用户列表页面

2025/2/25 11:27:50 来源:https://blog.csdn.net/ziyue13/article/details/121326748  浏览:    关键词:用MySQL+node+vue做一个学生信息管理系统(二):创建MySQL数据表、创建HTML用户列表页面

MySQL代码

CREATE DATABASE students;USE students;CREATE TABLE student(
id INT COMMENT '学号',
`name` VARCHAR(32) COMMENT '姓名',
sex VARCHAR(8) COMMENT '性别',
class VARCHAR(64) COMMENT '班级'
)SHOW TABLES;

下面介绍一下Vue框架的element-ui的使用方法,这里就不使用了,用原生的html做学生信息管理页面

1.安装依赖包: npm install element-ui -S
2.写入代码

//导入组件库
import ElementUI from 'element-ui'
//导入组件相关资源
import 'element-ui/lib/theme-chalk/index.css'
//配置Vue插件
Vue.use(ElementUI)

页面效果:现在页面的数据是固定死的,先看看效果,之后就需要往数据库获取数据然后渲染到页面当中
在这里插入图片描述

代码:

<template><div class="div1"><div class="div2"><div class="div21">学号</div><div class="div21">姓名</div><div class="div21">性别</div><div class="div21">班级</div><div class="div21"></div><div class="div21"></div></div><div class="div3" v-for="item in people"><div class="div31">{{item.id}}</div><div class="div31">{{item.name}}</div><div class="div31">{{item.sex}}</div><div class="div31">{{item.class}}</div><div class="div31"><button type="button" @click="update">更改</button></div><div class="div31"><button type="button" @click="del">删除</button></div></div></div></template><script>
export default {data(){return{msg:'66',people:[{id:1,name:'张三',sex:'男',class:'大数据'},{id:2,name:'李四',sex:'男',class:'物联网'}]}},methods:{update:function(){console.log('update')},del:function(){console.log('delete')}}
}
</script><style scoped="scoped">.div1{width: 800px;margin: auto;border: 1px solid transparent;}.div2{width: 100%;height: 50px;display: flex;}.div21{text-align: center;line-height: 50px;border: 1px solid aqua;flex: 1;}.div3{width: 100%;height: 50px;display: flex;}.div31{border: 1px solid aqua;text-align: center;line-height: 50px;flex: 1;}</style>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词