赞
踩
(1)mapper.xml 写 select insert update delete
<mapper namespace="cn.itsource.crm.mapper.DepartmentMapper"> <select id="queryAll" resultType="Department"> select * from t_department </select> <select id="queryOne" parameterType="long" resultType="Department"> select * from t_department where id = #{id} </select> <insert id="save" parameterType="Department"> insert into t_department(name) values (#{name}) </insert> <update id="update" parameterType="Department"> update t_department set name=#{name} where id=#{id} </update> <delete id="remove" parameterType="long"> delete from t_department where id=#{id} </delete> </mapper>
(2)在对应的controller写上 crud方法
(1) 创建一个Department.vue这个页面
(2) 配置路由
(3) main.js 引入axios
(4) 注释掉模拟数据
(5) 修改Department.vue这里面界面
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。