我用的是Vue,Vuetify,Vue-Router和Vuex的项目。其目的是在更模块化的方法中创建一个带有侧栏的基本布局,以便使用Vue实现可伸缩性。所以我创建了一个名为Store的文件夹,其中有一个模块文件夹。因此,存储文件夹中的索引文件如下所示:
import Vue from 'vue';
import Vuex from 'vuex';
import global from './Modules/Global';
Vue.use(Vuex);
export default new Vuex.Store({
modules:
我有一个应用程序,包含在这个div中:
<div id="app" v-bind:style='{backgroundColor: backgroundColor}'>
... the app ...
</div>
路由是按照 (这是webpack项目)完成的:
import Vue from 'vue/dist/vue.js'
import VueRouter from 'vue-router'
import ComponentOne from './component1.vue'
i
我正在尝试使用Axios将API中的所有数据返回给我的视图,并使用Vuex来存储我的状态。此源代码可以返回“”console.log“”,但不能传递给视图。
我尝试使用change mounted()来更改(),但它仍然不起作用
下面是我的源代码:在‘./store/modules/form.js’中:
import Vue from "vue";
import axios from "axios";
import VueAxios from "vue-axios";
Vue.use(VueAxios, axios);
const state
我正在制作一个与故事博客,vue和nuxt网站。在我的组件中,我试图通过从storyblok中获取一个值并在我的对象中获得正确的HEX代码来改变组件的背景色。然而,我似乎找不到出了什么问题,我得到了这个错误。
TypeError: Cannot read property 'color1' of undefined
at VueComponent.backgroundColor (app.js:6239)
at Watcher.get (commons.app.js:25459)
at Watcher.evaluate (commons.app.js:25564)
at Vue
我刚接触过vue,但我不明白为什么没有人能回答这个问题。我本以为这很简单,但我找不到任何地方谈论它。我有一个getCategory方法,它使用阿波罗查询我们的graphQL API。逻辑如下所示:
import { useQuery, useResult } from "@vue/apollo-composable";
import * as getCategoryBySlug from "@graphql/api/query.category.gql";
export function useGetCategory(slug: str