html一个页面链接携带参数跳转另一个页面基于vue2.0的element框架

来给生活比个耶!

1.按钮

   <el-button @click="albumList(scope.row.id)" size="mini" type="primary" size="small">相册列表</el-button>

2.js函数

   albumList (id){
                location.href=`album_list.html?id=`+id /*跳转页面传递id值*/
            },

3.钩子函数 加载截取参数id

   created(){
            var Ohref=window.location.href;
            var ids=Ohref.split("?id=");
            var id1 = ids[1];
            this.edit1(id1);
            console.log(id1+'接收参数id');
            this.fetchData();
        },

猜你喜欢

转载自www.cnblogs.com/july7/p/12081641.html