我尝试使用上面的方法更改浅色/深色主题默认背景颜色,但是它不起作用!!!这就是我所做的
在./src/scss/main.scss下添加新样式文件
// src/scss/main.scss
@import '~vuetify/src/styles/styles.sass'
$new-colors: (
'app-bar': map-get($red, 'lighten-4') !important,
'background': map-get($red, 'lighten-4') !important,
'cards': map-get($red, 'lighten-4') !important,
'bg-color': map-get($red, 'lighten-4') !important,
'fg-color': map-get($red, 'lighten-4') !important,
'text-color': map-get($red, 'lighten-4') !important,
'buttons': (
'disabled': map-get($red, 'lighten-4') !important,
'focused': map-get($red, 'lighten-4') !important,
'focused-alt': map-get($red, 'lighten-4') !important,
'pressed': map-get($red, 'lighten-4') !important,
),
);
$material-light: map-merge($material-light, $new-colors);
$material-dark: map-merge($material-dark, $new-colors);
@debug $material-light;
@import '~vuetify/src/styles/main.sass';
@import '~vuetify/src/components/VBtn/_variables.scss';
然后我像这样从./src/main.js 导入这个文件:
// ./src/main.js
import Vue from 'vue';
import vuetify from './plugins/vuetify';
import './scss/main.scss';
new Vue({
vuetify,
beforeCreate() {
console.log('Before our APP is created');
},
mounted() {
console.log('Our APP is being mounted now.');
},
render: function(h) {
return h(App);
}
}).$mount('#app');
我正在使用vue 2.6.7 和vuetify 2.1.7