# ui/autolayout/layoutconstraintaxis (vanilla.js 0.4.0)

> https://vanillapunch.com/docs/vanilla.js/0.4.0/api/ui/autolayout/layoutconstraintaxis/

레이아웃 제약 축. (UIKit 의 NSLayoutConstraint.Axis 와 같은 사상)

예제: 가로 축만 hugging 우선순위 올리기

```js
import { UINode, LayoutConstraintAxis, LayoutPriority } from "./build/vanilla.js";

const node = new UINode();
node.setContentHuggingPriority(LayoutPriority.required, LayoutConstraintAxis.horizontal);
const horizontalPriority = node.getContentHuggingPriority(LayoutConstraintAxis.horizontal);
const verticalPriority = node.getContentHuggingPriority(LayoutConstraintAxis.vertical);
console.log(horizontalPriority, verticalPriority);
```

## LayoutConstraintAxis (enum)

레이아웃 제약 축. (UIKit 의 NSLayoutConstraint.Axis 와 같은 사상)
- horizontal: 가로 축. width / left / right / centerX 와 관련된 제약을 의미.
- vertical:   세로 축. height / top / bottom / centerY 와 관련된 제약을 의미.

- `horizontal` = `horizontal`: 가로 축.
- `vertical` = `vertical`: 세로 축.
