| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <div
- :class="{'vfs-yes': value}"
- class="VciFormSwitch vci-transition"
- @pointerup="$emit('input', !value)"
- >
- <i
- class="vfs-point vci-transition-quick"
- ></i>
- </div>
- </template>
- <script>
- // power by visual-ceiling, at 2022/6/11 18:05
- export default {
- name: "VciFormSwitch",
- props: {
- value: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {};
- }
- };
- </script>
- <style lang="scss" scoped>
- .VciFormSwitch {
- width: 48px;
- height: 20px;
- border-radius: 16px;
- border: 1px solid #a4b6cc;
- cursor: pointer;
- background: rgba(#fff, 0.01);
- .vfs-point {
- display: block;
- width: 12px;
- height: 12px;
- box-shadow: 0 0 4px #333;
- border-radius: 100%;
- transform: translate(3px, 3px);
- background-color: #fff;
- }
- &.vfs-yes {
- background: #576b9d;
- .vfs-point {
- transform: translate(48 - 12 - 4 + px, 3px);
- }
- }
- }
- </style>
|