目录
-
default-active="$route.path" default-active="2" class="el-menu-vertical-demo" background-color="#334157" - text-color="#fff" active-text-color="#ffd04b" :collapse="collapsed" >
-
- "logobox">
- "logoimg" src="../assets/img/logo.png" alt="">
-
-
for="m in menus" :index="'idx_'+m.id" :key="'key_'+m.id"> - "title">
- "m.icon">
- {{m.text}}
-
-
for="m2 in m.modules" :index="m2.url" :key="'key_'+m2.id">> - "m2.icon">
- {{m2.text}}
-
-
-
-
- export default {
- data(){
- return{
- collapsed:false,
- menus:[]
- }
- },
- created() {
- this.$root.Bus.$on('aaa',v=>{
- this.collapsed =v;
- });
-
- let url=this.axios.urls.SYSTEM_MENUS;
- this.axios.get(url,{}).then(r=>{
- console.log(r);
- this.menus=r.data.rows;
- }).catch(e=>{
-
- })
- }
- }
- .el-menu-vertical-demo:not(.el-menu--collapse) {
- width: 240px;
- min-height: 400px;
- }
-
- .el-menu-vertical-demo:not(.el-menu--collapse) {
- border: none;
- text-align: left;
- }
-
- .el-menu-item-group__title {
- padding: 0px;
- }
-
- .el-menu-bg {
- background-color: #1f2d3d !important;
- }
-
- .el-menu {
- border: none;
- }
-
- .logobox {
- height: 40px;
- line-height: 40px;
- color: #9d9d9d;
- font-size: 20px;
- text-align: center;
- padding: 20px 0px;
- }
-
- .logoimg {
- height: 40px;
- }
- import Vue from 'vue'
- import Router from 'vue-router'
- import HelloWorld from '@/components/HelloWorld'
- import AppMain from '@/components/AppMain'
- import LeftNav from '@/components/LeftNav'
- import TopNav from '@/components/TopNav'
- import Login from '@/views/Login'
- import Register from '@/views/Register'
- import AddBook from '@/views/book/AddBook'
- import BookList from '@/views/book/BookList'
-
- Vue.use(Router)
-
- export default new Router({
- routes: [{
- path: '/',
- name: 'Login',
- component: Login
-
- },
- {
- path: '/Register',
- name: 'Register',
- component: Register
-
- },
- {
- path: '/AppMain',
- name: 'AppMain',
- component: AppMain,
- children: [{
- path: '/LeftNav',
- name: 'LeftNav',
- component: LeftNav
-
- },
- {
- path: '/TopNav',
- name: 'TopNav',
- component: TopNav
- },
- {
- path: '/book/AddBook',
- name: 'AddBook',
- component: AddBook
-
- },
- {
- path: '/book/BookList',
- name: 'BookList',
- component: BookList
- }
- ]
-
- }
-
- ]
- })
- "books" style="padding: 30px;">
-
-
"true" class="demo-form-inline"> -
"书籍名称"> -
"bookname" placeholder="书籍名称"> -
-
-
"primary" @click="onSubmit">查询 -
-
-
-
"tableData" stripe style="width: 100%"> -
"id" label="书籍编号" width="180"> -
-
"bookname" label="书籍名称" width="180"> -
-
"price" label="书籍价格"> -
-
-
"booktype" label="书籍类别"> -
-
-
- "block">
- "demonstration">完整功能
-
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="page"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="rows"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total">
-
-
-
-
- export default {
- data() {
- return {
- bookname: '',
- tableData:[],
- rows:10,
- page:1,
- total:0
- }
- },
- methods: {
- query(params){
- let url=this.axios.urls.BOOK_LIST;
- this.axios.get(url,{params:params}).then(r=>{
- console.log(r);
- this.tableData=r.data.rows;
- this.total = r.data.total;
- }).catch(e=>{
-
- })
- },
- onSubmit(){
- let params ={
- bookname : this.bookname
- }
- this.query(params);
- },
- handleSizeChange(r){
- console.log("当前页大小为:"+r);
- let params ={
- bookname : this.bookname,
- rows:r,
- page:this.pageS
- }
- this.query(params);
- },
- handleCurrentChange(p){
- console.log("当前页码为:"+p);
- let params ={
- bookname : this.bookname,
- rows:this.rows,
- page:p
- }
- this.query(params);
- }
- },
- created(){
- this.query({});
- }
- }
-
编写url路径
测试结果