-
Notifications
You must be signed in to change notification settings - Fork 0
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
日付コンポーネントの実装 #56
日付コンポーネントの実装 #56
Conversation
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.
気になるところ書きました。:pray:
src/components/UI/FormDate.vue
Outdated
|
||
<template> | ||
<div :class="$style.container"> | ||
<icon name="mdi:calendar-clock" :class="$style.icon" /> |
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.
カレンダーっぽいアイコンが2つ並んでて微妙だと思ったので、消すことにします。
<input | ||
:class="$style.input" | ||
:data-is-blank="props.modelValue === ''" | ||
type="datetime-local" | ||
:value="props.modelValue" | ||
@input="handleInput" |
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.
いい感じにデフォルトのアイコンもfocusしたときに色変わったらいいなって思ってます。
src/components/UI/FormDate.vue
Outdated
.container { | ||
display: flex; | ||
align-items: center; | ||
padding: 8px; |
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.
rem がいいかも?
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.
コンポーネントの動きは良さそうです。いい感じに動いててすごい!
Index.vueが置き換わってしまっているので、それだけ直してください。
src/pages/Index.vue
Outdated
<script lang="ts" setup> | ||
import ContentHeader from '/@/components/Layout/ContentHeader.vue' | ||
import PageInfoPanels from '/@/components/Index/PageInfoPanels.vue' | ||
import PageContainer from '/@/components/Layout/PageContainer.vue' | ||
import FormDuration from '/@/components/UI/FormDuration.vue' | ||
import { ref } from 'vue' | ||
import { Duration } from '/@/lib/apis' | ||
|
||
const value = ref<Duration>({ since: '', until: '' }) | ||
</script> | ||
|
||
<template> | ||
<page-container> | ||
<content-header | ||
icon-name="mdi:apps" | ||
:header-texts="[{ title: 'Top', url: '/' }]" | ||
detail="ポートフォリオの設定を変更します" | ||
:class="$style.header" | ||
/> | ||
<page-info-panels /> | ||
<form-duration v-model="value" /> | ||
</page-container> | ||
</template> |
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.
書き換わっているので、直してください
close #55
sinceとuntilがセットで使われていることが多そうなので、単体コンポーネントを2つ使ってセットのも作りました
必須アイコンはsinceのみ必須の場合は「~から」の横に、sinceもuntilも必須の場合は「日時」の横につけていそうなので、sinceのみの場合だけ対応しました(untilのみの場合は存在しないはず)
formDuration
は以下のような感じで動くと思います(formDate
はstring型の変数でv-model
使うだけです)