@uf_lee/leeui 1.0.3 → 1.0.5

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/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@uf_lee/leeui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "自己的组件库",
5
- "main": "dist/my-component-library.cjs.js",
6
- "module": "dist/my-component-library.esm.js",
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"
@@ -1,34 +1,9 @@
1
1
  <template>
2
- <div v-if="visible" class="my-component">
3
- <p>Hello! 我是一个全局单例组件</p>
4
- <button @click="close">关闭</button>
2
+ <div>
3
+ <p>Hello! 我是一个测试组件</p>
5
4
  </div>
6
5
  </template>
7
6
 
8
- <script setup lang="ts">
9
- import { ref } from "vue";
7
+ <script setup lang="ts"></script>
10
8
 
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>
9
+ <style scoped></style>
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 12:07:29
5
+ * @LastEditTime: 2025-03-20 13:37:31
6
6
  * @FilePath: \leelcp2022\lee_ui\src\index.ts
7
7
  * Copyright (c) 2025 by ${git_name_email}, All Rights Reserved.
8
8
  */
9
- export { showMyComponent, hideMyComponent } from "./MyComponentInstance";
10
- export { default as MyComponent } from "./MyComponent.vue";
9
+ import MyComponent from "./MyComponent.vue";
10
+
11
+ export { MyComponent };
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}
@@ -1,37 +0,0 @@
1
- import { defineComponent as a, ref as m, createElementBlock as i, createCommentVNode as u, openBlock as d, createElementVNode as r, createVNode as f, render as _ } from "vue";
2
- const v = {
3
- key: 0,
4
- class: "my-component"
5
- }, y = /* @__PURE__ */ a({
6
- __name: "MyComponent",
7
- setup(t, { expose: c }) {
8
- const e = m(!1);
9
- function l() {
10
- e.value = !0;
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();
32
- }
33
- export {
34
- x as MyComponent,
35
- h as hideMyComponent,
36
- b as showMyComponent
37
- };
@@ -1 +0,0 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.MyComponentLibrary={},n.Vue))})(this,function(n,e){"use strict";const f={key:0,class:"my-component"},l=((s,p)=>{const t=s.__vccOpts||s;for(const[d,c]of p)t[d]=c;return t})(e.defineComponent({__name:"MyComponent",setup(s,{expose:p}){const t=e.ref(!1);function d(){t.value=!0}function c(){t.value=!1}return p({open:d,close:c}),(y,r)=>t.value?(e.openBlock(),e.createElementBlock("div",f,[r[0]||(r[0]=e.createElementVNode("p",null,"Hello! 我是一个全局单例组件",-1)),e.createElementVNode("button",{onClick:c},"关闭")])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-58ee48fa"]]);let o=null,i=null;function m(){o||(i=document.createElement("div"),document.body.appendChild(i),o=e.createVNode(l),e.render(o,i)),o.component.exposed.open()}function u(){o&&o.component.exposed.close()}n.MyComponent=l,n.hideMyComponent=u,n.showMyComponent=m,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
@@ -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
- }