JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

vuex优化url传参

发布时间 2023-06-01 14:23:10作者: 会飞的小白

仅供个人学习记录,希望大家也能有所启发

引入

import { mapState, mapActions } from 'vuex'
export default {
  computed: {
    ...mapState(['userName', 'userInfo'])
  },
  mounted() {
    //存 this.$store.commit('key值',val值)
    this.$store.commit('setUserInfo', res.data.data)
    //取
    this.userName
    console.log(this.userInfo, 'userInfo---')
  }
}
    本栏目推荐文章
  • 手把手教你MongoDB 数据库连接URL 格式、authSource参数
  • web项目启动时dubbo报错: No provider available for the service com.davidhu.shopguide.api.service.UserEventService from the url zookeeper ://localhost:2181/org.apache.du
  • 微信小程序或js中获取url参数
  • SpringBoot配置报错:Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class
  • asp.net mvc2中controller的action无法获取url中过来bool类型参数
  • 使用Java编写的URL编码示例
  • URL编码揭秘:为什么要进行URL编码?
  • URL测试
  • druid数据源根据url自动加载相应驱动的原理 JDBC 的 DriverClass 示例
  • Python Flask 网页URL路由设置别名(alias) endpoint
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们