无法创建自定义 vuetify 主题颜色 [英] Cannot create custom vuetify theme colors

查看:38
本文介绍了无法创建自定义 vuetify 主题颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 vuetify.js 文件中,我添加了以下代码以创建自定义主题颜色:

In my vuetify.js file I have added the following code in order to create custom theme colors:

Vue.use(Vuetify, {
  theme: {
    primary: "#abd10d",
    secondary: "#5c40c1",
  }
});

但是,当我将主题应用于网站上的元素时,主题不会更新.主要和次要主题保持其默认颜色.

However, the themes do not update when I apply them to elements on the site. The primary and secondary themes remain their default colors.

为什么没有使用我的自定义主题颜色?

Why aren't my custom theme colors being used?

推荐答案

您需要使用 light(默认)或 dark...

You need to use light (default) or dark...

Vue.use(Vuetify, {
  theme: {
    light: {
       primary: "#abd10d",
       secondary: "#5c40c1",
    }
  }
})

演示:https://codeply.com/p/HWrpkuOskr

这篇关于无法创建自定义 vuetify 主题颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆