普通的js文件怎么使用vuex存放的属性值

//引入 这个路径是你自己项目的路径
import store from '@/store/index.js';
//打印整个state的属性
console.log(store.state)
//使用vuex的方法
store.commit('getIp',123) //getIp方法名,123为值

猜你喜欢

转载自blog.csdn.net/weixin_42821697/article/details/123293398