@uf_lee/leeui 1.0.3 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/my-component-library.es.js +13 -34
- package/dist/my-component-library.umd.js +1 -1
- package/dist/types/MyComponent.vue.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +4 -5
- package/src/components/Test.vue +9 -0
- package/src/index.ts +4 -3
- package/src/types/components/Test.vue.d.ts +2 -0
- package/src/types/index.d.ts +2 -0
- package/dist/leeui.css +0 -1
- package/src/MyComponent.vue +0 -34
- package/src/MyComponentInstance.ts +0 -29
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function n() {
|
|
13
|
-
e.value = !1;
|
|
14
|
-
}
|
|
15
|
-
return c({ open: l, close: n }), (k, s) => e.value ? (d(), i("div", v, [
|
|
16
|
-
s[0] || (s[0] = r("p", null, "Hello! 我是一个全局单例组件", -1)),
|
|
17
|
-
r("button", { onClick: n }, "关闭")
|
|
18
|
-
])) : u("", !0);
|
|
19
|
-
}
|
|
20
|
-
}), C = (t, c) => {
|
|
21
|
-
const e = t.__vccOpts || t;
|
|
22
|
-
for (const [l, n] of c)
|
|
23
|
-
e[l] = n;
|
|
24
|
-
return e;
|
|
25
|
-
}, x = /* @__PURE__ */ C(y, [["__scopeId", "data-v-58ee48fa"]]);
|
|
26
|
-
let o = null, p = null;
|
|
27
|
-
function b() {
|
|
28
|
-
o || (p = document.createElement("div"), document.body.appendChild(p), o = f(x), _(o, p)), o.component.exposed.open();
|
|
29
|
-
}
|
|
30
|
-
function h() {
|
|
31
|
-
o && o.component.exposed.close();
|
|
1
|
+
import { createElementBlock as c, openBlock as l, createElementVNode as s } from "vue";
|
|
2
|
+
const _ = (t, e) => {
|
|
3
|
+
const n = t.__vccOpts || t;
|
|
4
|
+
for (const [o, r] of e)
|
|
5
|
+
n[o] = r;
|
|
6
|
+
return n;
|
|
7
|
+
}, p = {};
|
|
8
|
+
function f(t, e) {
|
|
9
|
+
return l(), c("div", null, e[0] || (e[0] = [
|
|
10
|
+
s("p", null, "Hello! 我是一个测试组件", -1)
|
|
11
|
+
]));
|
|
32
12
|
}
|
|
13
|
+
const u = /* @__PURE__ */ _(p, [["render", f]]);
|
|
33
14
|
export {
|
|
34
|
-
|
|
35
|
-
h as hideMyComponent,
|
|
36
|
-
b as showMyComponent
|
|
15
|
+
u as MyComponent
|
|
37
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.MyComponentLibrary={},e.Vue))})(this,function(e,n){"use strict";const i=(o,t)=>{const r=o.__vccOpts||o;for(const[u,d]of t)r[u]=d;return r},c={};function f(o,t){return n.openBlock(),n.createElementBlock("div",null,t[0]||(t[0]=[n.createElementVNode("p",null,"Hello! 我是一个测试组件",-1)]))}const s=i(c,[["render",f]]);e.MyComponent=s,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uf_lee/leeui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "自己的组件库",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"types": "src/types/index.d.ts",
|
|
8
7
|
"files": [
|
|
9
8
|
"dist",
|
|
10
9
|
"src"
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
"dev": "vite",
|
|
20
19
|
"build": "vite build",
|
|
21
20
|
"build:types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json",
|
|
22
|
-
"publish": "
|
|
21
|
+
"publish": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.json && npm publish --access=public"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
24
|
"@vitejs/plugin-vue": "^5.2.3",
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* @Author: 李天惊 uf_lee@163.com
|
|
3
3
|
* @Date: 2025-03-20 11:24:35
|
|
4
4
|
* @LastEditors: 李天惊 uf_lee@163.com
|
|
5
|
-
* @LastEditTime: 2025-03-20
|
|
5
|
+
* @LastEditTime: 2025-03-20 13:52:37
|
|
6
6
|
* @FilePath: \leelcp2022\lee_ui\src\index.ts
|
|
7
7
|
* Copyright (c) 2025 by ${git_name_email}, All Rights Reserved.
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import Test from "./components/Test.vue";
|
|
10
|
+
|
|
11
|
+
export { Test };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
package/dist/leeui.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.my-component[data-v-58ee48fa]{position:fixed;top:20%;left:50%;transform:translate(-50%);padding:20px;background:#fff;border:1px solid #eee;box-shadow:0 0 10px #0000001a}
|
package/src/MyComponent.vue
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="visible" class="my-component">
|
|
3
|
-
<p>Hello! 我是一个全局单例组件</p>
|
|
4
|
-
<button @click="close">关闭</button>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
import { ref } from "vue";
|
|
10
|
-
|
|
11
|
-
const visible = ref(false);
|
|
12
|
-
|
|
13
|
-
function open() {
|
|
14
|
-
visible.value = true;
|
|
15
|
-
}
|
|
16
|
-
function close() {
|
|
17
|
-
visible.value = false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
defineExpose({ open, close });
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style scoped>
|
|
24
|
-
.my-component {
|
|
25
|
-
position: fixed;
|
|
26
|
-
top: 20%;
|
|
27
|
-
left: 50%;
|
|
28
|
-
transform: translateX(-50%);
|
|
29
|
-
padding: 20px;
|
|
30
|
-
background: #fff;
|
|
31
|
-
border: 1px solid #eee;
|
|
32
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: 李天惊 uf_lee@163.com
|
|
3
|
-
* @Date: 2025-03-20 12:07:04
|
|
4
|
-
* @LastEditors: 李天惊 uf_lee@163.com
|
|
5
|
-
* @LastEditTime: 2025-03-20 12:07:13
|
|
6
|
-
* @FilePath: \leelcp2022\lee_ui\src\MyComponentInstance.ts
|
|
7
|
-
* Copyright (c) 2025 by ${git_name_email}, All Rights Reserved.
|
|
8
|
-
*/
|
|
9
|
-
import { createVNode, render, VNode } from "vue";
|
|
10
|
-
import MyComponent from "./MyComponent.vue";
|
|
11
|
-
|
|
12
|
-
let instance: VNode | null = null;
|
|
13
|
-
let container: HTMLElement | null = null;
|
|
14
|
-
|
|
15
|
-
export function showMyComponent() {
|
|
16
|
-
if (!instance) {
|
|
17
|
-
container = document.createElement("div");
|
|
18
|
-
document.body.appendChild(container);
|
|
19
|
-
instance = createVNode(MyComponent);
|
|
20
|
-
render(instance, container);
|
|
21
|
-
}
|
|
22
|
-
(instance.component!.exposed as any).open();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function hideMyComponent() {
|
|
26
|
-
if (instance) {
|
|
27
|
-
(instance.component!.exposed as any).close();
|
|
28
|
-
}
|
|
29
|
-
}
|