在使用angular-gridster2时,如果调整大小不会调整内部子元素的大小,可以尝试使用Angular的动态绑定来解决此问题。下面是一个示例代码:
import { Component } from '@angular/core';
@Component({
selector: 'app-gridster',
templateUrl: './gridster.component.html',
styleUrls: ['./gridster.component.css']
})
export class GridsterComponent {
gridItems = [
{ width: 100, height: 100 },
{ width: 200, height: 200 },
// 其他子元素的宽度和高度
];
}
.gridster-item div {
border: 1px solid #ccc;
}
这样,当调整angular-gridster2中的子元素大小时,内部子元素的大小也会随之调整。您可以根据实际需求对示例代码进行适当的调整。