diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-11-25 21:31:34 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-25 21:31:34 +0900 |
| commit | 014440850014ee86d766bb07467c2970b17a1fc6 (patch) | |
| tree | ffb652fe1db3365d430ed72ec2c62aaacfbe21fb /src/client/components/form/radios.vue | |
| parent | フォントレンダリングを調整 (diff) | |
| download | misskey-014440850014ee86d766bb07467c2970b17a1fc6.tar.gz misskey-014440850014ee86d766bb07467c2970b17a1fc6.tar.bz2 misskey-014440850014ee86d766bb07467c2970b17a1fc6.zip | |
nanka iroiro (#6853)
* wip
* Update maps.ts
* wip
* wip
* wip
* wip
* Update base.vue
* wip
* wip
* wip
* wip
* Update link.vue
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update privacy.vue
* wip
* wip
* wip
* wip
* Update range.vue
* wip
* wip
* wip
* wip
* Update profile.vue
* wip
* Update a.vue
* Update index.vue
* wip
* Update sidebar.vue
* wip
* wip
* Update account-info.vue
* Update a.vue
* wip
* wip
* Update sounds.vue
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update account-info.vue
* Update account-info.vue
* wip
* wip
* wip
* Update d-persimmon.json5
* wip
Diffstat (limited to 'src/client/components/form/radios.vue')
| -rw-r--r-- | src/client/components/form/radios.vue | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/src/client/components/form/radios.vue b/src/client/components/form/radios.vue new file mode 100644 index 0000000000..4c7f405cac --- /dev/null +++ b/src/client/components/form/radios.vue @@ -0,0 +1,106 @@ +<script lang="ts"> +import { defineComponent, h } from 'vue'; +import MkRadio from '@/components/ui/radio.vue'; +import './form.scss'; + +export default defineComponent({ + components: { + MkRadio + }, + props: { + modelValue: { + required: false + }, + }, + data() { + return { + value: this.modelValue, + } + }, + watch: { + value() { + this.$emit('update:modelValue', this.value); + } + }, + render() { + const label = this.$slots.desc(); + const options = this.$slots.default(); + + return h('div', { + class: 'cnklmpwm _formItem' + }, [ + h('div', { + class: '_formLabel', + }, label), + ...options.map(option => h('button', { + class: '_button _formPanel _formClickable', + key: option.props.value, + onClick: () => this.value = option.props.value, + }, [h('span', { + class: ['check', { checked: this.value === option.props.value }], + }), option.children])) + ]); + } +}); +</script> + +<style lang="scss"> +.cnklmpwm { + > button { + display: block; + width: 100%; + box-sizing: border-box; + padding: 14px 18px; + text-align: left; + + &:not(:first-of-type) { + border-top: none !important; + border-top-left-radius: 0; + border-top-right-radius: 0; + } + + &:not(:last-of-type) { + border-bottom: solid 0.5px var(--divider); + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + + > .check { + display: inline-block; + vertical-align: bottom; + position: relative; + width: 20px; + height: 20px; + margin-right: 8px; + background: none; + border: 2px solid var(--inputBorder); + border-radius: 100%; + transition: inherit; + + &:after { + content: ""; + display: block; + position: absolute; + top: 3px; + right: 3px; + bottom: 3px; + left: 3px; + border-radius: 100%; + opacity: 0; + transform: scale(0); + transition: .4s cubic-bezier(.25,.8,.25,1); + } + + &.checked { + border-color: var(--accent); + + &:after { + background-color: var(--accent); + transform: scale(1); + opacity: 1; + } + } + } + } +} +</style> |