fuint-uniapp-master/components/xuan-switch/xuan-switch.vue

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<template>
  <view class="switch-container" :style="[{ background: bj_color}]">
    <view class="switch_view">
      <view 
        class="switch-item" 
        :class="{'checked_switch':isSwitch}"
        :style="isSwitch?`color:${checked_color}`:''"
        @click.prevent.stop="changeSwitch(true)"
        :animation="animationData2"
      >
        {{switchList[0]}}
      </view>
      <view 
        class="switch-item"
        :class="{'checked_switch':!isSwitch}"
        :style="!isSwitch?`color:${checked_color}`:''"
        @click.prevent.stop="changeSwitch(false)"
        :animation="animationData3"
      >
        {{switchList[1]}}
      </view>
    </view>
    <view class="disabled" v-if="disabled"></view>
    <view 
      class="position_view" :animation="animationData1"
      :style="[{ background: checked_bj_color}]"
    ></view>
  </view>
</template>

<script>
export default {
  props: {
    switchList: {
      type: Array,
      default: ()=>{
        return ['开','关'];
      }
    },
    defaultSwitch:{
      type:Boolean,
      default:true
    },
    isShowModal:{//改变开关时,是否弹框提醒
      type:Boolean,
      default:false
    },
    disabled:{
      type:Boolean,
      default:false
    },
    bj_color:{
      type:String,
      default:'#fff'
    },
    checked_bj_color:{
      type:String,
      default:'#1989fa'
    },
    checked_color:{
后面还有 124 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。