首页 > 我在做文件系统,单页面,点击文件夹进入下一级这样的,可以用vue-router么?我只有一个组件

我在做文件系统,单页面,点击文件夹进入下一级这样的,可以用vue-router么?我只有一个组件

html:
{{ i.name }}
javascript:
var Listrouter = Vue.component( 'model', {

    template: '#main-tmpl',
    data: function(){
        return {
            is_personal_data: "0",
            keySearch: true,           //关键字搜索
            sizeSearch: false,         //大小搜索
            dateSearch: false,         //日期搜索
            typeList: [],              //返回文件列表
            getdata: this.getList()
        }
    },
    methods: {
        /**点击分别显示对应查询方法**/
        whichSearch: function(index){
            switch(index){
                case 1 :
                    this.keySearch=true;
                    this.sizeSearch=false;
                    this.dateSearch=false;
                    break;
                case 2 :
                    this.keySearch=false;
                    this.sizeSearch=true;
                    this.dateSearch=false;
                    break;
                case 3 :
                    this.keySearch=false;
                    this.sizeSearch=false;
                    this.dateSearch=true;
                    break;
            }
        },
        getList: function(){
            var that = this;
            console.log(that.$route.params)
            if(that.$route.params.id==undefined){
                alert(1321321)
            }else {
                alert("色即是空")
            }

            var obj= {                  //加载数据时请求的参数
                    id: "0",
                    name:"",
                    keyword: "",
                    fileSize: "",
                    startDate: "",
                    endDate: "",
                    fileType: "",
                    orderKey: "",
                    order: "",
                    pageNum: 0
                };
            /**获取文件列表**/
            that.$http.get('/file/operation/list/' + obj.id , { keyword: obj.keyword, fileSize: obj.fileSize , startDate: obj.startDate , endDate: obj.endDate, fileType: obj.fileType , orderKey: obj.orderKey , order: obj.order , pageNum: obj.pageNum,pageSize:50})
                .then(function (response) {
                        that.typeList = response.data;
                        that.typeList.fileList.map(function(s){
                            s.isSelect=false;
                            s.rename=true;
                        });
                    },function (response){}
                )
        }
    }
});

router.map({

    '/': {
        component: Listrouter,
        subRouter: {

        }
    },
    '/name/:id': {
        name: 'sss',
        component: Listrouter
    }
});

【热门文章】
【热门文章】