-
Notifications
You must be signed in to change notification settings - Fork 139
Docs/reactive api #927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs/reactive api #927
Conversation
src/reactive/index.ts
Outdated
| * Reactive state properties for Flicking | ||
| * @ko Flicking의 반응형 상태 속성들 | ||
| * @interface | ||
| * @property {boolean} isReachStart - Whether Flicking has reached the first panel<ko>첫 번째 패널에 도달했는지 여부</ko> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 @Property는 안쓰셔도 될거dpdy.
아래에서 쓰고 있어서
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/reactive/index.ts
Outdated
| * @property {Flicking | null} flicking - Flicking instance or null<ko>Flicking 인스턴스 또는 null</ko> | ||
| */ | ||
| export interface FlickingReactiveData { | ||
| flicking: Flicking | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Property가 아니라 property에 직접 주석을 달아주세요. 위에 처럼
| const options = getProps().options; | ||
|
|
||
| // options를 고려하지 않고 초기값을 설정해도 동작에는 아무런 문제가 없으나, 이 시점의 초기값과 컴포넌트 init 단계에서의 초기값이 다르면 화면 리렌더링이 발생할 수 있으므로 | ||
| // 이렇게 미리 옵션을 통해서 예측할 수 있는 부분들은 맞춰둔다. | ||
| const reactiveObj: FlickingReactiveObject = reactive({ | ||
| isReachStart: false, // 이 값을 전달 받은 옵션을 이용해서 설정. getProps()를 통해 전달된 옵션을 사용하여 설정할 수 있습니다. | ||
| isReachEnd: false, // | ||
| totalPanelCount: 0, // | ||
| currentPanelIndex: 0, // | ||
| progress: 0, // | ||
| indexProgress: 0, // | ||
| isReachStart: (options?.defaultIndex === 0 && !options.circular), | ||
| isReachEnd: false, | ||
| totalPanelCount: 0, | ||
| currentPanelIndex: options?.defaultIndex ?? 0, | ||
| progress: 0, | ||
| indexProgress: 0, | ||
| moveTo | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daybrush 님, 전달받은 옵션을 통해서 미리 맞춰둘 수 있는 초기값은 isReachStart, currentPanelIndex 정도인 것 같아서 이 정도로만 일단 작성했습니다.
얘기하신게 이게 맞는지 한번 확인 부탁드리고, 혹시 다른 값들도 미리 맞춰둘 수 있는 게 있다고 보시면 말씀 부탁드립니다.
| onInit((inst, data) => { | ||
| flicking = data.flicking; | ||
| if (flicking === null) return; | ||
| if (flicking === undefined) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== null
src/reactive/index.ts
Outdated
| const reactiveObj: FlickingReactiveObject = reactive({ | ||
| isReachStart: false, | ||
| isReachStart: (options?.defaultIndex === 0 && !options.circular), | ||
| isReachEnd: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totalPanelCount에 대한 options도 있었으면 좋겠습니다.
src/reactive/index.ts
Outdated
| currentPanelIndex: 0, | ||
| currentPanelIndex: options?.defaultIndex ?? 0, | ||
| progress: 0, | ||
| indexProgress: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indexProgress: options?.defaultIndex ?? 0,


Details