第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

寫axios攔截器時(shí)獲取vuex sotre對(duì)象時(shí)遇到的問(wèn)題,求幫助?

寫axios攔截器時(shí)獲取vuex sotre對(duì)象時(shí)遇到的問(wèn)題,求幫助?

DIEA 2018-08-30 14:19:11
axios攔截器獲取vuex sotre對(duì)象時(shí)用import為undefined 可以用require獲取,這是為什么?這樣寫獲取不到但是在main.js中是用這種方法獲取的,可以獲取到import axios from 'axios' import store from '@/store' console.log(store)// undefined下面這樣寫能獲取到import axios from 'axios'const store = require('@/store') console.log(store) //可以獲取有什么地方出問(wèn)題了嗎?這是store下的indeximport Vue from 'vue' import Vuex from 'vuex' import login from './modules/login' import getArticleList from './modules/getArticleList'//  import createLogger from 'vuex/dist/logger'Vue.use(Vuex) const debug = process.env.NODE_ENV !== 'production'export default new Vuex.Store({  modules: {     login,     getArticleList   },  strict: debug   // plugins: debug ? [createLogger()] : [] })
查看完整描述

3 回答

?
qq_LAL_2

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊

你好 我也遇到了你的問(wèn)題 請(qǐng)問(wèn)問(wèn)題解決了嗎


查看完整回答
反對(duì) 回復(fù) 2019-09-09
?
守著一只汪

TA貢獻(xiàn)1872條經(jīng)驗(yàn) 獲得超4個(gè)贊

你的store是不是沒有默認(rèn)導(dǎo)出

查看完整回答
反對(duì) 回復(fù) 2018-09-09
?
瀟湘沐

TA貢獻(xiàn)1816條經(jīng)驗(yàn) 獲得超6個(gè)贊

在main.js中引入封裝好攔截器的axios時(shí),axios需要放在store之前,不然在axios攔截器中無(wú)法獲取store對(duì)象

import axios from './axios'
import store from '@/store'


查看完整回答
反對(duì) 回復(fù) 2018-09-09
  • 3 回答
  • 0 關(guān)注
  • 2761 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)