@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.
@@ -1,37 +1,16 @@
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();
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
- x as MyComponent,
35
- h as hideMyComponent,
36
- b as showMyComponent
15
+ u as MyComponent
37
16
  };
@@ -1 +1 @@
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
+ (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;
@@ -0,0 +1,2 @@
1
+ import MyComponent from "./MyComponent.vue";
2
+ export { MyComponent };
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.6",
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"
@@ -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": "npm run build && npm 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",
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div>
3
+ <p>Hello! 我是一个测试组件</p>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts"></script>
8
+
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: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
- export { showMyComponent, hideMyComponent } from "./MyComponentInstance";
10
- export { default as MyComponent } from "./MyComponent.vue";
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;
@@ -0,0 +1,2 @@
1
+ import Test from "./components/Test.vue";
2
+ export { Test };
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,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
- }