[新增] menu 菜单组件
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<li class="layui-nav-item">
|
||||
<a href="">{{ title }} </a>
|
||||
<a href="javascript:void(0)">{{ title }} </a>
|
||||
</li>
|
||||
|
||||
<li class="layui-nav-item" v-if="slots.default">
|
||||
<a href="">
|
||||
<li class="layui-nav-item" :class="[isOpen?'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>
|
||||
</a>
|
||||
@@ -15,11 +15,18 @@
|
||||
</template>
|
||||
|
||||
<script setup name="LayMenuItem" lang="ts">
|
||||
import { defineProps, useSlots } from 'vue'
|
||||
import { defineProps, ref, useSlots } from 'vue'
|
||||
const slots = useSlots()
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
title: string
|
||||
}>()
|
||||
}>()
|
||||
|
||||
const isOpen = ref(false)
|
||||
|
||||
const openHandle = function() {
|
||||
isOpen.value = !isOpen.value
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user