Vue Fluid 컴포넌트
Fluid는 하위 컴포넌트들이 컨테이너의 전체 폭을 차지하도록 만들어 주는 레이아웃 컴포넌트예요. 입력 필드마다 일일이 fluid를 지정하는 대신 한 번에 감싸는 편리한 방법을 제공해요.
출처: 문서
본문
Vue Fluid Component
Fluid is a layout component to make descendant components span full width of their container.
Import
import Fluid from 'primevue/fluid';
Accessibility
Screen Reader Fluid는 어떤 role이나 속성도 필요로 하지 않아요. Keyboard Support 이 컴포넌트에는 인터랙티브 요소가 없어요.
Basic
InputText처럼 fluid 옵션을 가진 컴포넌트는 컴포넌트 전체 폭을 차지할 수 있어요. 컴포넌트마다 일일이 fluid를 켜는 것은 번거로울 수 있으니, 내용을 Fluid로 감싸는 편이 더 쉬운 대안이에요. fluid 프로퍼티를 가진 컴포넌트라면 무엇이든 Fluid 컴포넌트 안에 중첩할 수 있어요. 마지막 샘플에서 보듯 하위 컴포넌트의 fluid 프로퍼티가 fluid 컨테이너보다 우선순위가 높아요.
<div>
<label for="non-fluid" class="font-bold mb-2 block">Non-Fluid</label>
<InputText id="non-fluid" />
</div>
<div>
<label for="fluid" class="font-bold mb-2 block">Fluid Prop</label>
<InputText id="fluid" fluid />
</div>
<Fluid>
<span class="font-bold mb-2 block">Fluid Container</span>
<div class="grid grid-cols-2 gap-4">
<div><InputText /></div>
<div><InputText /></div>
<div class="col-span-full"><InputText /></div>
<div><InputText :fluid="false" placeholder="Non-Fluid" /></div>
</div>
</Fluid>
Fluid
Props
| Name | Type | Default | Description |
|---|---|---|---|
| dt | any | - | It generates scoped CSS variables using design tokens for the component. |
| pt | PassThrough | - | Used to pass attributes to DOM elements inside the component. |
| ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
| unstyled | boolean | false | When enabled, it removes component related styles in the core. |
Slots
| Name | Parameters | Description |
|---|---|---|
| default | Function |
Pass Through Options
| Name | Type | Description |
|---|---|---|
| root | FluidPassThroughOptionType | Used to pass attributes to the root's DOM element. |
| hooks | any | Used to manage all lifecycle hooks. |
Theming
CSS Classes
| Class | Description |
|---|---|
| p-fluid | Class name of the root element |