Cannot read properties of undefined (reading 'getters') problem in vue project

Project scenario:

Introduce split modules in index.js of vuex


Problem Description

import {toastStatus} from "./toastStatus";

Will report the following error

 
 

 

Cause Analysis:

The index.js of toastStatus is exported as a whole with export default, but the on-demand import format is used when citing, so an error is reported


solution:

Just delete the curly braces

import toastStatus from "./toastStatus";

Guess you like

Origin blog.csdn.net/weixin_39155926/article/details/127749737