有没有办法使用 CSS 制作具有粘性第一列的 Angular Material?
这里准备编辑Stackblitz代码
我尝试调整此解决方案https://jsfiddle.net/zinoui/BmLpV/,但由于某些原因,第一列被抛出表格本身,并且失去了样式。
<div class="zui-wrapper">
<div class="zui-scroller">
<table class="zui-table">
<thead>
<tr>
<th class="zui-sticky-col">Name</th>..........
</tr>
</thead>
<tbody>
<tr>
<td class="zui-sticky-col">DeMarcus Cousins</td>
.......
<tr>
</tbody>
</table>
</div>
</div>
.zui-scroller {
margin-left: 141px;
overflow-x: scroll;
overflow-y: visible;
padding-bottom: 5px;
width: 300px;
}
.zui-table .zui-sticky-col {
border-left: solid 1px #DDEFEF;
border-right: solid 1px #DDEFEF;
left: 0;
position: absolute;
top: auto;
width: 120px;
}
Run Code Online (Sandbox Code Playgroud) 有像这样的标记
<mat-cell *matCellDef="let request">
<a [href]="request.url" target="_blank">{{request.requestId}}</a>
</mat-cell>
Run Code Online (Sandbox Code Playgroud)
我可以以某种方式键入IDE的请求类型Request吗?我在这里使用IntelliJ。
请注意,我这里使用的是Angular Material表,因此request在此处声明组件不是一个选择,因为它纯粹是模板变量。它包含在每次行迭代时由组件本身内部提供的行数据。
知道为什么不推荐使用它,但是可能是因为它看起来像无效的标记-很好,它是MatDataTable组件中使用的完全有效的标记。
我有一组集成测试,包括图像文本识别和用户交互。对于测试,我使用静态图像而不是相机输入。我已包含这些图像,以便assets能够通过 访问测试中的图像rootBundle。但现在,这些将包含在应用程序的生产版本中。
如何添加仅用于测试的资产?
flutter:
assets: #I need those to be bundled for tests but not for production build
- ./test/resources/
- ./test/resources/barcodes/
Run Code Online (Sandbox Code Playgroud) 我正在使用maven-jar-plugin构建jar maven-assembly-plugin并将所有依赖项放在JARin lib/目录旁边.
如果我使用此项目的快照依赖项,则Class-Path入口点会执行不同JAR的依赖项,然后是实际的打包项.
这是一个例子:
<dependency>
<groupId>x.y.z</groupId>
<artifactId>artifact</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
JAR被打包为依赖INTI libdirecotyr是
artifact-1.0-SNAPSHOT,但Class-Path在主入口JAR小号表现为lib/artifact-1.0-20170201.104414-8.jar
这里发生了什么,为什么?
提前致谢.
我的assembly.xml
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
Run Code Online (Sandbox Code Playgroud)
插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.2</version>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<finalName>${dist.name}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>${basedir}/assembly.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>.</Class-Path>
</manifestEntries>
</archive>
<outputDirectory>${dist.dir}</outputDirectory>
</configuration>
<executions>
<execution>
<goals> …Run Code Online (Sandbox Code Playgroud) 简而言之 - 我有2个旋转矩形.在旋转时(通过Y轴)它们应该相互重叠 - 不幸的是,尽管旋转180度,但是其中一个ractangles"总是在前面".如何解决这种行为?它似乎与whitch矩形中的顺序相关,并且已添加到组中.最后添加的那个总是在前面.
现场:
package drawing.scene;
import javafx.application.Application;
import javafx.geometry.Point3D;
import javafx.scene.Camera;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
import javafx.scene.transform.Rotate;
import javafx.stage.Stage;
import drawing.objects.Clock;
import drawing.objects.Cube;
public class MyScene extends Application {
private int sceneEdgeSize = 800;
private int clolcSize = 400;
@Override
public void start(Stage primaryStage) throws Exception {
Group g = new Group();
g.setTranslateX((sceneEdgeSize - clolcSize) / 2f);
g.setTranslateY((sceneEdgeSize - clolcSize) / 2f);
final Cube c = new Cube(clolcSize);
g.getChildren().add(c);
Thread t = new Thread(new Runnable() …Run Code Online (Sandbox Code Playgroud) 我有通过将属性文件放置在类路径的根上来配置的第三方库。该库getClass().getResourceAsStream("/file.properties")用于加载该文件。由于是第三方,因此无法修改。我已经将该配置文件放入了外部 resources目录(不要误解为resourcesMaven或Gradle的目录结构。
目录结构是这样的。
如何运行/配置Spring Boot以将resources目录的内容包含到类路径中,以便可以getResourceAsStream正常工作?
在SE应用程序上,我只需要java -jar myApp.jar对MANIFEST中的classpath进行操作即可。
编辑:
只需说明一下-将配置文件放入项目资源(以及资源)中就没了重点。我想保持配置外部化。
所以我想将最大可分页大小值限制为 10(示例值),我可以这样做:
@Configuration
public class MvcConfiguration extends WebMvcConfigurerAdapter {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
PageableHandlerMethodArgumentResolver resolver = new PageableHandlerMethodArgumentResolver();
resolver.setMaxPageSize(10);
argumentResolvers.add(resolver);
}
}
Run Code Online (Sandbox Code Playgroud)
和delcare控制器方法像这样
@RequestMapping(name = "list")
public String listUsers(@PageableDefault(size = 5, page = 0) Pageable pageable) {
Run Code Online (Sandbox Code Playgroud)
事实上,这会起作用,我无法将页面大小设置为> 10,但我很好奇为什么?Spring 创建的发生了什么PageableHandlerMethodArgumentResolver?为什么要考虑此实例而不是默认实例?毕竟,我不会在这里更换解析器,只是添加一个新的解析器。
我想使用拦截器向通过 rest 模板发出的每个请求添加授权标头。我这样做:
public FirebaseCloudMessagingRestTemplate(@Autowired RestTemplateBuilder builder, @Value("fcm.server-key") String serverKey) {
builder.additionalInterceptors(new ClientHttpRequestInterceptor() {
@Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
request.getHeaders().add("Authorization", "key=" + serverKey);
System.out.println(request.getHeaders());
return execution.execute(request, body);
}
});
this.restTemplate = builder.build();
}
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做时
DownstreamHttpMessageResponse response = restTemplate.postForObject(SEND_ENDPOINT, request, DownstreamHttpMessageResponse.class);
Run Code Online (Sandbox Code Playgroud)
没有调用拦截器(我在其中放置了断点,但它没有触发)。发出请求并返回明显丢失的身份验证密钥响应。为什么我的拦截器没有被调用?
我正在使用IntelliJ启动Karma.一切看起来都不错,新的Chrome窗口弹出,但它会永远保持加载状态.
业力日志:
17 07 2018 13:29:01.754:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9877/
17 07 2018 13:29:01.758:INFO [launcher]: Launching browser Chrome with unlimited concurrency
17 07 2018 13:29:01.773:INFO [launcher]: Starting browser Chrome
10% building modules 1/3 modules 2 active …ts\rafa-components-lib\src\polyfills.ts
10% building modules 2/3 modules 1 active …ts\rafa-components-lib\src\polyfills.ts
75% basic chunk optimization EnsureChunkConditionsPlugin
75% basic chunk optimization RemoveParentModulesPlugin
88% hashing
90% additional chunk assets processing
92% after chunk asset optimization SourceMapDevToolPlugin main.js generate SourceMap
Waiting for a captured browser... To …Run Code Online (Sandbox Code Playgroud) 我有一个有角度的应用程序,我正在使用引导程序和有角度的材料来设计它。我想为应用创建标题,并且标题中有2个按钮,一个位于左侧,另一个则位于右侧。
这是我的组件
<mat-toolbar>
<mat-toolbar-row>
<button mat-raised-button>
<fa name="cog"></fa>
</button>
<button mat-raised-button class="float-right">
<fa name="refresh"></fa>
</button>
</mat-toolbar-row>
</mat-toolbar>
Run Code Online (Sandbox Code Playgroud)
注意:我已经尝试了pull-right和float-right。
添加引导程序我安装了引导程序模块并将其添加到style.css
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
@import "../node_modules/bootstrap/dist/css/bootstrap.css";
Run Code Online (Sandbox Code Playgroud)
另外,我在应用程序中添加了ng-bootsrap模块,并将其导入到我的应用程序组件中
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
ReactiveFormsModule,
MatButtonModule,
AngularFontAwesomeModule,
MatToolbarModule,
NgbModule.forRoot(),
],
providers: [],
bootstrap: [AppComponent]
})
Run Code Online (Sandbox Code Playgroud)
但是似乎没有任何效果,可以正确按下我的按钮,有什么想法吗?
angular ×3
spring ×3
java ×2
bootstrap-4 ×1
css ×1
flutter ×1
jar ×1
javafx ×1
karma-runner ×1
maven ×1
resttemplate ×1
spring-boot ×1
spring-mvc ×1