| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <template>
- <div class="VciFormCheckbox">
- <input
- :checked="checked"
- :name="name"
- type="checkbox"
- @input="$emit('change', $event.target.checked)"
- />
- <i class="vfc-icon vci-transition-quick vci-bg-fill"></i>
- </div>
- </template>
- <script>
- // power by visual-ceiling, at 2022/9/27 15:27
- export default {
- name: "VciFormCheckbox",
- model: {
- prop: "checked",
- event: "change"
- },
- props: {
- name: {
- type: String,
- default: "fc"
- },
- checked: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {};
- }
- };
- </script>
- <style lang="scss" scoped>
- .VciFormCheckbox {
- position: relative;
- width: 20px;
- height: 20px;
- .vfc-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 ~ .vfc-icon {
- opacity: 1 !important;
- }
- }
- }
- </style>
|