【发布时间】:2021-06-18 11:51:49
【问题描述】:
我在我的插件目录中创建了一个文件,如下所示:
import Vue from "vue";
import Vuetify from "vuetify/lib/framework";
Vue.use(Vuetify);
export default new Vuetify({
theme: {
themes: {
light: {
primary: "#081d4d", // $blue
secondary: "#00c8b7", // $jade
//anchor: "#081d4d", // $blue (by default vuetify styles anchors with the same colour of primary)
accent: "#82B1FF", // $blue
error: "#ff4438", // $warm-red
info: "#835dd0", // $violet
success: "#4CAF50", // none
warning: "#ff8204", // $orange
},
},
},
});
然后我像这样在我的 main.ts 中使用它:
import "./registerServiceWorker";
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import { provide } from "@vue/composition-api";
import { DefaultApolloClient } from "@vue/apollo-composable";
import "./plugins/axios";
import vuetify from "./plugins/vuetify";
import apolloClient from "./plugins/vue-apollo";
Vue.config.productionTip = false;
new Vue({
router,
store,
vuetify,
setup() {
provide(DefaultApolloClient, apolloClient);
},
render: (h) => h(App),
}).$mount("#app");
当我使用按钮或警报并设置它们的颜色时,它没有使用我的主题。 此外,即使我尝试更改为深色主题,也没有任何反应。 这是模板:
<template>
<div class="container-fluid d-flex align-items-center justify-content-center">
<div class="row">
<div class="col">
<div class="section section-white">
<h1>This is a test</h1>
<p>With some tests content</p>
<v-btn color="primary">Test</v-btn>
<v-alert type="info"></v-alert>
</div>
</div>
</div>
</div>
</template>
这是我的用户界面的样子:
据我所知,我已经正确地遵循了指示,所以我不知道为什么这不起作用。
【问题讨论】:
标签: vue.js vuejs2 vuetify.js