typescript - Vuetify 不应用默认颜色,组件为白色
问题描述
我正在为我的项目使用 Vuetify。问题是默认主题是白色的,或者带有道具“黑色”的黑色。
我检查了这篇文章:Vuetify:颜色没有显示 即使我将组件代码放在 v-app 中,它仍然是黑色的。
我没有改变任何东西,我想?
我使用路由器-vue。
下面是我的代码:App.vue
<template>
<div id="app">
<router-view />
</div>
</template>
<style lang="scss"></style>
我的组件:
<template>
<v-card max-width="400">
<v-app-bar dark>
<v-toolbar-title>Formulaire de connexion</v-toolbar-title>
</v-app-bar>
<v-col>
<v-form v-model="valid" lazy-validation ref="form">
<v-row>
<v-text-field
:rules="rulesLogin"
label="Identifiant"
v-model="identifiant"
></v-text-field>
</v-row>
<v-row>
<v-text-field
:rules="rulesLogin"
type="password"
label="Mot de passe"
v-model="motDePasse"
></v-text-field>
</v-row>
<v-row>
<v-btn color="primary" dark @click="seConnecter">Se connecter</v-btn>
</v-row>
<v-row>
<v-btn color="primary" dark>Mot de passe oublié ?</v-btn>
</v-row>
<v-row>
<v-btn color="primary" dark>Pas de compte ? Créer un compte</v-btn>
</v-row>
</v-form>
</v-col>
</v-card>
</template>
<script>
import service from "@/services/login.services";
export default {
name: "LoginForm",
data() {
return {
valid: true,
identifiant: "",
motDePasse: ""
};
},
computed: {
rulesLogin() {
return [v => !!v || "Ce champ est obligatoire"];
}
},
methods: {
seConnecter() {
if (this.$refs.form.validate()) {
const params = {
identifiant: this.identifiant,
motDePasse: this.motDePasse
};
service.connexion(params);
}
}
}
};
</script>
<style></style>
插件/vuetify.js:
import Vue from "vue";
import Vuetify from "vuetify/lib";
Vue.use(Vuetify);
export default new Vuetify({});
main.js
import Vue from "vue";
import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";
import vuetify from "./plugins/vuetify";
Vue.config.productionTip = false;
new Vue({
router,
store,
vuetify,
render: h => h(App)
}).$mount("#app");
谢谢 =)
解决方案
推荐阅读
- python - 在字段名称之后搜索自定义字段
- python - 在 python 构造函数中缺少 1 个必需的位置参数
- html - 在 asp.net 的转发器数据源控件中,服务器标记的格式不正确
- angular - 断开连接后 Strophe.js 未重新连接
- vue.js - VueJs:如何将当前的迭代项传递给对话框?
- spring-boot - 如何访问 th:objects 列表并使用 th:each 遍历它?
- linkedin - LinkedIn API:获取当前速率限制
- javascript - 循环谷歌图表数据行
- c++ - 使用#include 将大量重复代码放入单独的文件中是否可以和/或正常?
- visual-studio - 忽略构建后事件错误