switch.vue 473 B

1234567891011121314151617181920
  1. <template>
  2. <view class="content" style="margin-top: 30rpx;">
  3. <zzx-switch v-model="switchState" active-color="#6cb3f0" inactive-color="#909399"
  4. @change="handleSwitchChange" />
  5. </view>
  6. </template>
  7. <script setup lang="ts">
  8. import { ref } from 'vue'
  9. import zzxSwitch from '@/components/zzx-switch/zzx-switch.vue'
  10. const switchState = ref(false)
  11. const handleSwitchChange = (value : boolean) => {
  12. console.log('状态:', value)
  13. }
  14. </script>
  15. <style scoped>
  16. </style>