style(prettier): reset code style with prettier
This commit is contained in:
@@ -3,7 +3,7 @@ import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LaySwitch', Component)
|
||||
app.component(Component.name || 'LaySwitch', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
|
||||
@@ -1,33 +1,32 @@
|
||||
<template>
|
||||
<span @click="handleClick">
|
||||
<div class="layui-unselect layui-form-switch"
|
||||
:class="{
|
||||
'layui-form-onswitch': modelValue == true,
|
||||
'layui-checkbox-disbaled layui-disabled': disabled
|
||||
}">
|
||||
<em>{{modelValue == true ? "启用" : "禁用"}}</em>
|
||||
<i></i>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
|
||||
<span @click="handleClick">
|
||||
<div
|
||||
class="layui-unselect layui-form-switch"
|
||||
:class="{
|
||||
'layui-form-onswitch': modelValue == true,
|
||||
'layui-checkbox-disbaled layui-disabled': disabled,
|
||||
}"
|
||||
>
|
||||
<em>{{ modelValue == true ? '启用' : '禁用' }}</em>
|
||||
<i />
|
||||
</div>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script setup name="LaySwitch" lang="ts">
|
||||
import { defineProps, defineEmits } from 'vue'
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
modelValue: boolean
|
||||
disabled?: boolean
|
||||
}>()
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
disabled?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const handleClick = function() {
|
||||
if(props.disabled) {
|
||||
return false
|
||||
}
|
||||
emit('update:modelValue',!props.modelValue)
|
||||
const handleClick = function () {
|
||||
if (props.disabled) {
|
||||
return false
|
||||
}
|
||||
emit('update:modelValue', !props.modelValue)
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user