Vue.js store prompts Cannot read property 'commit' of undefined

store, has been introduced but I don"t know why I still prompt undefined, to solve it! Thank you
import Vue from "vue"
import iView from" iview"
import "iview/dist/styles/iview.css"
import Router from".. / router"
import store from". / store/quanxianStore"

import App from".. /.. / vue/admin/quanxian.vue"

Vue.use (iView)

new Vue ({

el: "-sharpapp",
router: Router,
store: store,
render: h => h(App)

})
/ * *

  • Extends interfaces in Vue.js

* /

vue.d.ts
import Vue, {ComponentOptions} from "vue";
import {Store} from ". / index";

declare module "vue/types/options" {
interface ComponentOptions < V extends Vue > {

store?: Store<any>;
quanxianStore?: Store<any>;

}
}

declare module "vue/types/vue" {
interface Vue {

$store: Store<any>;
$quanxianStore: Store<any>;

}
}

clipboard.png

Mar.25,2022

possible reasons:

  1. failed to quote vux, correctly when using store.commit, resulting in an error;
  2. you may use it this way, when you deconstruct the assignment, you open it in the wrong way, resulting in an error.

clipboard.png

in short, you should check the code that an object with a value of undefined reports an error when referencing the commit property.


you have solved it yourself!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf370-223e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf370-223e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?