style(prettier): reset code style with prettier
This commit is contained in:
@@ -6,4 +6,4 @@ Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LaySelectOption', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
export default Component as IDefineComponent
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
<template>
|
||||
<dd :value="value" @click="selectHandle" :class="[selectItem.value === value?'layui-this':'']">
|
||||
{{label}}
|
||||
</dd>
|
||||
<dd
|
||||
:value="value"
|
||||
:class="[selectItem.value === value ? 'layui-this' : '']"
|
||||
@click="selectHandle"
|
||||
>
|
||||
{{ label }}
|
||||
</dd>
|
||||
</template>
|
||||
|
||||
<script setup name="LaySelectOption" lang="ts">
|
||||
import { SelectItem } from '../type'
|
||||
import { defineProps, inject } from 'vue'
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
value?: string
|
||||
label?: string
|
||||
}>()
|
||||
const props = defineProps<{
|
||||
value?: string
|
||||
label?: string
|
||||
}>()
|
||||
|
||||
const selectItem = inject("selectItem") as SelectItem
|
||||
const selectItem = inject('selectItem') as SelectItem
|
||||
|
||||
const selectHandle = function(){
|
||||
const selectHandle = function () {
|
||||
selectItem.value = props.value
|
||||
selectItem.label = props.label
|
||||
}
|
||||
|
||||
// init selected
|
||||
|
||||
if(selectItem.value === props.value) {
|
||||
if (selectItem.value === props.value) {
|
||||
selectItem.value = props.value
|
||||
selectItem.label = props.label
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user