我正在App.vue的App.vue钩子组件中对我的商店进行调度调用,然后在子组件中使用getter请求,问题似乎是,在加载应用程序时,在数据被放在存储区之前加载了子组件,并且没有显示。我对此很有信心,因为我记录了控制台,第一个日志是子组件,它是商店的使用者。如何保证在加载任何其他组件之前,需要在站点范围内运行dispatch?
// App.vue
created() {
this.$store.dispatch(this.$mts.diseases.DISEASES_LIST) //note I tried with async/await to no avail
我是新来的Vue打字本。我试图创建全局组件,但是我得到了警告,而且模板上没有加载组件。这就是我试图创建全局组件的方式。
App.vue
import { createApp } from "vue"
import App from "./App.vue"
import "./registerServiceWorker"
import "./globalComponents"
import router from "./router"
import store from "./store"
crea
目标是让用户从Firebase访问并使用Vuex存储状态,当应用程序打开时,我使用状态来了解用户是否登录,并将其用于更多的操作。我需要获得一个状态来在data()方法上填充App.vue文件上的变量,但是它显然没有得到正确的引用。加载页面时,会发生以下错误:
[Vue warn]: Error in data(): "TypeError: this.$state is undefined"
found in
---> <App> at src/App.vue
<Root>
和
[Vue warn]: Property or meth
我的main.js如下
import Vue from 'vue'
import App from './App'
import vueResource from 'vue-resource'
import VueRouter from 'vue-router'
import Registration from './components/Registration.vue'
import Login from './components/Login.vue'
Vue.config.produ
在我的Laravel + Vue.js SPA (单页应用程序)中,我使用axios作为HTTP来发出POST请求。在Vue组件即Register.vue中,我有:
axios.post('@{{ route("register") }}',
this.name, // the data to post
{ headers: {
'Content-type': 'application/json'
我经常收到这样的错误消息:
Uncaught Error: []: getActivePinia was called with no active Pinia. Did you forget to install pinia?
const pinia = createPinia()
app.use(pinia)
This will fail in production.
at useStore (pinia.mjs?b318:1692:1)
at eval (App.vue?91a0:77:1)
at ./node_modules/babel-load
我正尝试在一个VueJS项目中使用VueStrap,看起来webpacker可以很好地加载它,我可以在终端输出中看到这一点,但是,当我尝试使用vue-strap中的组件时,我得到了这个错误:
[Vue warn]: Property or method "input" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based componen