Vaadin 找不到我的主题 [英] Vaadin can't find my themes

查看:46
本文介绍了Vaadin 找不到我的主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误:

信息:未找到请求的资源 [/VAADIN/themes/mytheme/styles.css]从文件系统或通过类加载器.添加小部件集和/或主题JAR 文件添加到您的类路径或将文件添加到 WebContent/VAADIN 文件夹.

INFO: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

我正在使用 Intellij.这是我的文件夹结构:

I'm using intellij. Here is my folder structure:

我的 mytheme.scss:

My mytheme.scss:

@import "../valo/valo.scss";
@mixin mytheme {
    @include valo;
    .v-button {
        color: blue;
        background: yellow;
    }
}

我的styles.scss:

My styles.scss:

@import "mytheme.scss";
@import "addons.scss";
.mytheme {
    @include mytheme;
    @include addons;
}

我的 web.xml:http://wklej.org/id/2144139/

My web.xml: http://wklej.org/id/2144139/

我的 pom.xml:http://wklej.org/id/2144140/

My pom.xml: http://wklej.org/id/2144140/

我已经像在文档中一样编译了 scss https://vaadin.com/docs/-/part/framework/themes/themes-compiling.html#themes.compiling.maven 并且我没有处于生产模式.

I have compiled scss like in docs https://vaadin.com/docs/-/part/framework/themes/themes-compiling.html#themes.compiling.maven and I'm not in production mode.

我不知道我做错了什么.

I don't know what I'm doing wrong.

推荐答案

手动将目录标记为资源根解决了这个问题.

Manually marking directory as resources root solved it.

在 Intellij 中是这样的:

Did it like that in Intellij:

  1. 右键单击 webapp 文件夹
  2. 然后将目录标记为"
  3. 然后选择资源根目录"

令人惊讶的是,只需标记文件夹即可解决问题.

It's surprising that simply marking the folder solves the problem.

这篇关于Vaadin 找不到我的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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