本文介绍了纳克斯Vuetify:如何控制CSS文件的加载顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Nuxt / Vuetify 应用中,我试图在 Vuetify 的CSS,但是之后无论如何加载 Vuetify 的CSS。我试图反转CSS数组中的顺序:

In my Nuxt/Vuetify app I'm trying to load my custom CSS after Vuetify's CSS, but Vuetify's CSS gets loaded afterwards no matter what. I tried to reverse the order in the CSS array:

css: [
    '~/assets/style/main.scss',
    '~/assets/style/app.styl'
  ],

...并四处交换,无济于事。

... and swap these around, to no avail.

,加上缺乏答案,使我认为问题出在 Vuetify '一方,而作者没有不必解决这个问题。

The popularity of a previous question on this topic combined with its lack of answer makes me think the problem is on Vuetify' side and authors didn't bother to fix the issue.

但是也许这不是正确的解释,确实有解决方案?

But maybe that's not the right explanation and there's indeed a solution?

推荐答案

对于Nuxt来说,这似乎是一个悬而未决的问题,不幸的是没有解决。 Vuetify说他们不认为这是对的:

It seems like it's an open issue with Nuxt, and it's unfortunately not solved. Vuetify says they don't think it's on their side:https://github.com/vuetifyjs/vuetify-loader/issues/23

截至Nuxt ^ 2.7.1 ,人们对css文件加载不一致存在问题。在此问题中,有和。

As of Nuxt ^2.7.1, people are having issues with inconsistent css file loading. There's a reference to it in this issue, as well as this issue.

似乎他们正在尝试对其进行修复,。不过,不幸的是,在发布此版本之前,我相信除了恢复到较低版本以外,您还可以做很多事情。

It does seem like they are attempting to fix it, as noted here. Unfortunately though, until this is released, I don't believe there's much you could do besides reverting to a lower version.

这篇关于纳克斯Vuetify:如何控制CSS文件的加载顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 07:00