it seems that the vuex document does not have a commit global state, and the moutaions parameter only the global state, getter has rootstate,. So how do I commit the global state?
it seems that the vuex document does not have a commit global state, and the moutaions parameter only the global state, getter has rootstate,. So how do I commit the global state?
can't you introduce the global js into the module?
Yes, in context
let GETLIST = 'GETLIST';
export default{
namespaced: true,
mutations: {
[GETLIST](state, { context, param }){
console.log(context.rootState)
}
},
actions: {
OPERATION(context, param){
context.commit([GETLIST], { context, param })
}
}
}
Previous: DriverManager.getConnection (url, username, password) can't connect to SQLSERVER.
Next: Openlayers3 knows the actual distance, how to calculate the pixel distance on the screen?
try to get store data in the route file, but the undefined vuexmodule modulestore is displayed. ...
first of all, before the user logs in, I want to determine whether the user is logged in according to the value stored in cookies or vuex. If cookies logs in, it will store the userId and userName fields. then, my vuex goes like this: import Vuex fro...
when vue router switches pages, there will be stutters: pauses on the current page (and scrolls to the top) before switching to the new page the address bar changes immediately. Back to the top is the configuration item of the route, indicating that ...
I have referenced another component in one component. What can I do to refresh the referenced component when a value changes? or call the destroy method of another component in the current component ...
if you can t understand the meaning of the title, then look at the picture . the top yellow part is the public part in app.vue the red part is vue-router green < router-view > part what I need to implement now is when I click on the red navigat...
this is my current routing structure. question 1. At first, we thought of the bottom navigation as a first-level route, and all page jumps were under navigation, but registration and login wanted to fill the full screen, so it became a first-level rout...
get the value returned by the backend after logging in, vuex vue-router and then report an error Cannot convert undefined or null to object,. How to solve this problem ...
there is an initial data interface from 1 to 4, and the subsequent navigation data is obtained from the database; and the first-level routes are directed to the first by default; when I click 1, the route to 4 is displayed. Ask for a simple demo or som...
vuex: import axios from axios ; import ip, {token} from . ip ; import store from @ store ; console.log(store); storeundefined import Store from @ utils store ; cookie axios.defaults.withCredentials = false; axios .interceptor...
Logic generally means that users generate routing tables through user token and generate new routes through addRoute, but get user information through token. Refreshing the page will execute router.beforeEach many times, resulting in multiple visits ...
Route with parameter jump, intercepted by 404 Route Jump Code to: { path: report detail , query: { id: row.deviceId, cid: _t.selectedCompany.companyId ...
when I first came into contact with vue, development, I found that this warning error will appear no matter where I click on the project page. I don t know if I have ever met anyone who made this error. Ask God for advice ...
as there are more and more routes, more and more components are introduced into router.js, and each particular page corresponds to a different component. is this a reasonable way to write? It feels weird ...
how do I declare a global variable in a project generated by vue-cli? My personal understanding is that main.js is an entry file and App.vue is a root-level component. If a variable is declared here, webpack will be packaged recursively. But why can t t...
for example, after the phone is bound, the status of the page should be updated. What is the specific method? ...
multiple definitions of an attribute are not allowed in the output SCRIPT1046: strict mode in the ie console. related dependencies: "dependencies": { "axios": "^0.18.0", "qs": "^6.5.2", &...
if the question passes import store from @ store store.js ...
there is a background management system routing nesting relationship: app.vue > a.vue > b.vue I want to do this: send a request to verify the validity of token in app.vue send a data request in a b, and the parameters of the data request depend o...
vue has the following route nesting: > app.vue > a.vue > b.vue app.vue is the ingress, an is a level 2 route, and b is a child of a when accessing the b route, the request written in an and some column hook events will be called repeatedly. What ...
has the following routes app.vue > a.vue > b.vue a.vue is a full-screen content b.vue is also a full-screen content, and less parts are shared with a, so you can ignore router-view at the bottom of a.vue . when a-> b, the content of an is above th...