首页 > 解决方案 > Vaadin Java:css文件的导入问题

问题描述

我正在编写 Vaadin 教程系列第 8 部分

视频:https ://www.youtube.com/watch?v=ttuBu8dYNn0

文本版本:https ://vaadin.com/learn/tutorials/modern-web-apps-with-spring-boot-and-vaadin/creating-custom-reusable-components-in-vaadin?medium=social

因此,我正在努力导入给定的 css 文件的最后一步。我所做的与所示教程中的完全相同,但表单样式没有改变。似乎css文件不起作用。

Vaadin 版本 14.4.2

我的项目文件夹包括。主视图:

在此处输入图像描述

CSS 文件:

/* List view */
.list-view .content {
    display: flex;
}

.list-view .contact-grid {
    flex: 2;
}

.list-view .contact-form {
    flex: 1;
    padding: var(--lumo-space-m);
}

@media all and (max-width: 1100px) {
    .list-view.editing .toolbar,
    .list-view.editing .contact-grid {
        display: none;
   }
}

我的网络应用程序

在此处输入图像描述

应该是这样的:

在此处输入图像描述

标签: javacssvaadinvaadin-flowvaadin10

解决方案


在我添加了有关其他问题的以下依赖项后解决:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

推荐阅读