图书管理前端页面

1.图书管理页面
1.1 http/apis.js 添加后端请求路由
import { get, post, put, del } from './index'
// 书籍管理接口
export const getBookList = (params, headers) => get("/books/book/", params,
headers)
export const addBook = (params, headers) => post("/books/book/", params, headers)
export const editBook = (params, headers) => put("/books/book/", params, headers)
export const delBook = (params, headers) => del("/books/book/", params, headers)
1.2 router/index.js 添加路由

import Books from '@/views/books/Books'
export default new Router({
routes: [
{ path: '/', name: 'Books', component: Books }, // 图书增删改查
案例
]
})
1.3 src\views\books\Books.vue 父组件

1.4 src\components\BookEdit.vue 子组件 1.5 src/mian.js 引入ElementUI

// The Vue build version to load with the import command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
Vue.config.productionTip = false
// 使用 elementui
// npm i element-ui -S 安装到当前项目
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: ''
})

上一篇:rancher2.X笔记(十三):k8s环境下安装中文分词插件


下一篇:对于list集合里面的Object参数除1000,取小数点后三位