-
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
✨ ToggleSwitchを実装 #26
Conversation
src/components/UI/ToggleSwitch.vue
Outdated
<script lang="ts" setup> | ||
const props = withDefaults( | ||
defineProps<{ | ||
modelValue?: boolean |
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.
optionalにする必要がなさそうかなーと思ったのですが、modelValueを使わない場面って何か想定していますか?
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.
formの中で使う場面もないので、optionalにする必要ないですね。修正しました:pray:
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.
これに伴って、modelValueのdefault値も消しておいてほしいです🙏
src/components/UI/ToggleSwitch.vue
Outdated
<label :class="$style.container"> | ||
<input | ||
type="checkbox" | ||
:checked="props.modelValue" |
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.
checked
は現在の選択状態じゃなくて初期値を表すらしいので、checkedじゃなくてvalueの方がいい気がします(それとは別にcheckedをpropsで用意してもいいとは思います)(それとも何か別の意図がありますか?)
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.
v-modelを使うように修正しました:pray:
src/components/UI/ToggleSwitch.vue
Outdated
.input:disabled + & { | ||
pointer-events: none; | ||
cursor: not-allowed; | ||
} |
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.
手元で確認してみた感じ、ここ効いてるかちょっと怪しい感じがしたのでもう一度確認してみていただきたいです
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.
効いてなかった & pointer-events: none;がいらなさそう?なので、修正しました:pray:
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.
#26 (comment)
ここ以外はよさそうです 👍
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 #18