vue 的几个方法

小白一枚 大神绕路哈

页面跳转传递参数

发送

1
2
3
4
this.$router.push({
name: "api_list_edit",
params: { modify: this.sel_currentRow }
});

接收

1
this.$route.params.modify

请求图片

1
2
var img = require('../images/who.jpg');
this.$store.commit('setAvator', img);

使用 Cookie

1
2
3
4
import Cookies from 'js-cookie';
axios.defaults.withCredentials = true;

Cookies.set('password', 'admin');