style(prettier): reset code style with prettier

This commit is contained in:
落小梅
2021-10-12 11:30:07 +08:00
parent aee99c49c9
commit 2b59e008f3
148 changed files with 4296 additions and 4191 deletions

View File

@@ -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

View File

@@ -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>