html 页眉中带有p-selectButton的p-calendar

vsnjm48y  于 2023-11-15  发布在  其他
关注(0)|答案(1)|浏览(100)

我正在做一些 Jmeter 板,我需要使用p-calendar过滤一些东西。我想让这个组件看起来像另一个:

正如你所看到的,第一个问题是p-selectButton元素,它占用了太多的空间。我真的不需要它更小,我只是想让它适合在线。如果日历组件变宽并不重要,在我看来,我认为这比减少selectButton组件要好。
这是我的代码:

  1. <p-calendar [view]='calendarView'>
  2. <ng-template pTemplate='header'>
  3. <p-selectButton [options]='timeViewOpions' [(ngModel)]='timeView' [multiple]='false' optionLabel='name'
  4. optionValue='value' (onChange)='onTimeViewChange()'></p-selectButton>
  5. </ng-template>
  6. </p-calendar>

字符串
这将是宏伟的,如果你以某种方式帮助我,使它的功能。主要问题是显示的p-选择按钮,但如果你能帮助我的功能,这将是伟大的!非常感谢你

fhity93d

fhity93d1#

解决方案是添加styleClass flex

  1. <p-calendar [view]='calendarView'>
  2. <ng-template pTemplate='header'>
  3. <p-selectButton [options]='timeViewOpions' [(ngModel)]='timeView' [multiple]='false' optionLabel='name'
  4. optionValue='value' (onChange)='onTimeViewChange()' styleClass='flex'></p-selectButton>
  5. </ng-template>
  6. </p-calendar>

字符串

相关问题