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

@@ -6,4 +6,4 @@ Component.install = (app: App) => {
app.component(Component.name || 'LaySelect', Component)
}
export default Component as IDefineComponent
export default Component as IDefineComponent

View File

@@ -1,7 +1,10 @@
<template>
<select :name="name" lay-verify="required">
</select>
<div class="layui-unselect layui-form-select" @click="open" :class="[openState?'layui-form-selected':'']">
<select :name="name" lay-verify="required" />
<div
class="layui-unselect layui-form-select"
:class="[openState ? 'layui-form-selected' : '']"
@click="open"
>
<div class="layui-select-title">
<input
type="text"
@@ -9,11 +12,11 @@
:value="selectItem.label"
readonly=""
class="layui-input layui-unselect"
/><i class="layui-edge"></i>
/><i class="layui-edge" />
</div>
<dl class="layui-anim layui-anim-upbit" style="">
<dd lay-value="" @click="clean" class="layui-select-tips">请选择</dd>
<slot></slot>
<dd lay-value="" class="layui-select-tips" @click="clean">请选择</dd>
<slot />
</dl>
</div>
</template>
@@ -21,32 +24,30 @@
<script setup name="LaySelect" lang="ts">
import { defineProps, provide, reactive, ref, watch } from 'vue'
const props =
defineProps<{
modelValue?: string
name?: string
}>()
const props = defineProps<{
modelValue?: string
name?: string
}>()
const openState = ref(false)
const open = function() {
openState.value = !openState.value
const open = function () {
openState.value = !openState.value
}
const selectItem = reactive({label:"",value:props.modelValue});
const selectItem = reactive({ label: '', value: props.modelValue })
provide("selectItem",selectItem);
provide('selectItem', selectItem)
// select update 时, 通知 change 事件
const emit = defineEmits(['update:modelValue'])
watch(selectItem, function(item) {
watch(selectItem, function (item) {
emit('update:modelValue', item.value)
})
const clean = function() {
selectItem.value = "";
selectItem.label = "";
const clean = function () {
selectItem.value = ''
selectItem.label = ''
}
</script>