| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <div class="VciFormRadio">
- <input
- :checked="value === label"
- :name="name"
- :value="value"
- type="radio"
- @input="$emit('change', label)"
- />
- <i class="vfr-icon vci-transition-quick vci-bg-fill"></i>
- </div>
- </template>
- <script>
- // power by visual-ceiling, at 2022/9/27 15:27
- export default {
- name: "VciFormRadio",
- model: {
- prop: "value",
- event: "change"
- },
- props: {
- name: {
- type: String,
- default: "fr"
- },
- value: {
- type: String,
- default: "fr"
- },
- label: {
- type: String,
- default: ""
- }
- },
- data() {
- return {};
- }
- };
- </script>
- <style lang="scss" scoped>
- .VciFormRadio {
- position: relative;
- width: 20px;
- height: 20px;
- .vfr-icon {
- position: relative;
- z-index: 1;
- display: block;
- width: 100%;
- height: 100%;
- opacity: 0.4;
- background-color: #fff;
- }
- input {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 6;
- width: 100%;
- height: 100%;
- opacity: 0;
- cursor: pointer;
- &:checked ~ .vfr-icon {
- opacity: 1;
- }
- }
- }
- </style>
|