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 || 'LayMenuItem', Component)
|
||||
app.component(Component.name || 'LayMenuItem', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<template>
|
||||
|
||||
<li
|
||||
v-if="slots.default"
|
||||
class="layui-nav-item"
|
||||
:class="[isOpen && isTree ? 'layui-nav-itemed' : '']"
|
||||
v-if="slots.default"
|
||||
>
|
||||
<a href="javascript:void(0)" @click="openHandle">
|
||||
{{ title }}
|
||||
<i class="layui-icon layui-icon-down layui-nav-more"></i>
|
||||
<i class="layui-icon layui-icon-down layui-nav-more" />
|
||||
</a>
|
||||
<dl
|
||||
class="layui-nav-child"
|
||||
@@ -16,11 +15,16 @@
|
||||
!isTree ? 'layui-anim layui-anim-upbit' : '',
|
||||
]"
|
||||
>
|
||||
<slot></slot>
|
||||
<slot />
|
||||
</dl>
|
||||
</li>
|
||||
|
||||
<li v-else class="layui-nav-item" @click="selectHandle()" :class="[selectKey === id ? 'layui-this':'']">
|
||||
<li
|
||||
v-else
|
||||
class="layui-nav-item"
|
||||
:class="[selectKey === id ? 'layui-this' : '']"
|
||||
@click="selectHandle()"
|
||||
>
|
||||
<a href="javascript:void(0)">{{ title }} </a>
|
||||
</li>
|
||||
</template>
|
||||
@@ -29,22 +33,21 @@
|
||||
import { defineProps, inject, Ref, ref, useSlots } from 'vue'
|
||||
const slots = useSlots()
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
id: string
|
||||
title: string
|
||||
}>()
|
||||
const props = defineProps<{
|
||||
id: string
|
||||
title: string
|
||||
}>()
|
||||
|
||||
const isOpen = ref(false)
|
||||
|
||||
const isTree = inject('isTree')
|
||||
const selectKey: Ref<String> = inject('selectKey') as Ref<String>
|
||||
const selectKey: Ref<string> = inject('selectKey') as Ref<string>
|
||||
|
||||
const openHandle = function () {
|
||||
isOpen.value = !isOpen.value
|
||||
}
|
||||
|
||||
const selectHandle = function() {
|
||||
selectKey.value = props.id
|
||||
const selectHandle = function () {
|
||||
selectKey.value = props.id
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user