在Vaadin 10 Flow中替换Vaadin 8 Framework中的`AbsoluteLayout`吗? [英] Replacement for `AbsoluteLayout` from Vaadin 8 Framework in Vaadin 10 Flow?

查看:111
本文介绍了在Vaadin 10 Flow中替换Vaadin 8 Framework中的`AbsoluteLayout`吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AbsoluteLayout 在Vaadin 8(框架)中,可以在布局中实现面向像素位置的窗口小部件放置.虽然不是我的首选布局,但AbsoluteLayout适合从其他使用面向像素位置的布局的UI构建平台中移植代码.

The AbsoluteLayout in Vaadin 8 (Framework) enables pixel-position-oriented placement of widgets within a layout. While not my first layout of choice, the AbsoluteLayout is suited to porting code from other UI-building platforms that use pixel-position-oriented layout.

示例代码手册中的:

// A 400x250 pixels size layout
AbsoluteLayout layout = new AbsoluteLayout();
layout.setWidth("400px");
layout.setHeight("250px");

// A component with coordinates for its top-left corner
TextField text = new TextField("Somewhere someplace");
layout.addComponent(text, "left: 50px; top: 50px;");

我可以看到传递的参数只是CSS编码.但是我不是HTML/CSS向导,这就是为什么我首先使用基于Java的Vaadin的原因.

I can see that the passed argument is simply CSS coding. But I am no HTML/CSS wizard, that’s why I am using Java-based Vaadin in the first place.

迁移指南 Vaadin 8(框架)到Vaadin 10(流程)在此组件列表中说,即 中的8不包括在10中,也不打算在将来添加.但是该页面确实提供了有关替换AbsoluteLayout的注释:

The migration guide for moving from Vaadin 8 (Framework) to Vaadin 10 (Flow) says in this list of components that the AbsoluteLayout from 8 is not included in 10, nor do they plan to add it in the future. But that page does offer this note about replacement for AbsoluteLayout:

使用例如div

Very easy to achieve the same in V10 using e.g. Div

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