Merge branch 'develop' of https://gitee.com/dingyongya/layui-vue into setup

 Conflicts:
	example/src/router/zh-CN.ts
	src/index.ts
This commit is contained in:
dingyongya
2022-01-04 18:15:23 +08:00
27 changed files with 508 additions and 422 deletions

View File

@@ -0,0 +1,9 @@
import type { App } from "vue";
import { LayLayer } from "@layui/layer-vue";
import type { IDefineComponent } from "../type/index";
LayLayer.install = (app: App) => {
app.component(LayLayer.name || "LayLayer", LayLayer);
};
export default LayLayer as IDefineComponent;

View File

@@ -1,9 +0,0 @@
import type { App } from "vue";
import { LayModal } from "@layui/layer-vue";
import type { IDefineComponent } from "../../type/index";
LayModal.install = (app: App) => {
app.component(LayModal.name || "LayModal", LayModal);
};
export default LayModal as IDefineComponent;

View File

@@ -1,9 +0,0 @@
import type { App } from "vue";
import Component from "./index.vue";
import type { IDefineComponent } from "../type/index";
Component.install = (app: App) => {
app.component(Component.name || "LayMenuChildItem", Component);
};
export default Component as IDefineComponent;

View File

@@ -1,25 +0,0 @@
<template>
<dd :class="[selectedKey === id ? 'layui-this' : '']" @click="selectHandle()">
<slot v-if="slots.title" name="title"></slot>
<a v-else href="javascript:void(0)">
{{ title }}
</a>
</dd>
</template>
<script setup name="LayMenuChildItem" lang="ts">
import { defineProps, inject, Ref, useSlots } from "vue";
const slots = useSlots();
const props = defineProps<{
id: string;
title: string;
}>();
const selectedKey: Ref<string> = inject("selectedKey") as Ref<string>;
const selectHandle = function () {
selectedKey.value = props.id;
};
</script>