Skip to content

Commit

Permalink
fix XListのborderを修正, アロー関数
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyme committed Apr 25, 2023
1 parent 7eb42b6 commit 94ef700
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions packages/client/src/components/MkDateSeparatedList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export default defineComponent({
setup(props, { slots, expose }) {
const $style = useCssModule();
function getDateText(time: string) {
const getDateText = (time: string): string => {
const date = new Date(time).getDate();
const month = new Date(time).getMonth() + 1;
return i18n.t('monthAndDay', {
month: month.toString(),
day: date.toString(),
});
}
};
if (props.items.length === 0) return;
Expand Down Expand Up @@ -113,14 +113,14 @@ export default defineComponent({
return children;
};
function onBeforeLeave(el: HTMLElement) {
const onBeforeLeave = (el: HTMLElement): void => {
el.style.top = `${el.offsetTop}px`;
el.style.left = `${el.offsetLeft}px`;
}
function onLeaveCanceled(el: HTMLElement) {
};
const onLeaveCanceled = (el: HTMLElement): void => {
el.style.top = '';
el.style.left = '';
}
};
return () => h(
defaultStore.state.animation ? TransitionGroup : 'div',
Expand Down Expand Up @@ -182,6 +182,13 @@ export default defineComponent({
border-bottom: solid 0.5px var(--divider);
}
}
&.reversed > * {
&:not(:last-child) {
border-bottom: none;
border-top: solid 0.5px var(--divider);
}
}
}
.direction-up {
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/components/MkPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ watch([$$(backed), $$(contentEl)], () => {
});
if (props.pagination.params && isRef(props.pagination.params)) {
watch(props.pagination.params, init, { deep: true });
watch(props.pagination.params, () => init(), { deep: true });
}
watch(queue, (a, b) => {
if (a.length === 0 && b.length === 0) return;
emit('queue', queue.value.length);
}, { deep: true });
async function init(): Promise<void> {
const init = async (): Promise<void> => {
queue.value = [];
fetching.value = true;
const params = props.pagination.params ? unref(props.pagination.params) : {};
Expand Down Expand Up @@ -210,7 +210,7 @@ async function init(): Promise<void> {
error.value = true;
fetching.value = false;
});
}
};
const reload = (): Promise<void> => {
items.value = [];
Expand Down

0 comments on commit 94ef700

Please sign in to comment.