lty-protocol 1.0.8 → 1.0.10

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.
@@ -0,0 +1,21 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: HTMLButtonElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
11
+ click: () => any;
12
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
13
+ onClick?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
15
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
+ export default _default;
17
+ type __VLS_WithTemplateSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,21 @@
1
- import { default as MyButton } from './components/MyButton.vue';
2
1
  import { Plugin } from 'vue';
2
+ import { default as MyButton } from './components/MyButton.vue';
3
+ import { default as Button2 } from './components/button2.vue';
4
+ /**
5
+ * 插件
6
+ * @description 引用时请通过 name 字段引用,例如:import { Protocol } from 'lty-protocol'
7
+ */
3
8
  declare const Protocol: Plugin;
4
- export { MyButton };
9
+ /**
10
+ * 导出组件
11
+ */
12
+ export { MyButton, Button2 };
13
+ /**
14
+ * 导出协议模型
15
+ */
16
+ export * from './models';
17
+ export * from './types';
18
+ /**
19
+ * 导出插件
20
+ */
5
21
  export default Protocol;
@@ -1 +1 @@
1
- .my-btn[data-v-c654f959]{padding:6px 12px;border:1px solid #ccc}
1
+ .my-btn[data-v-c654f959],.my-btn[data-v-1477cfc3]{padding:6px 12px;border:1px solid #ccc}
@@ -1,34 +1,65 @@
1
- import { defineComponent as s, openBlock as r, createElementBlock as a, renderSlot as l } from "vue";
1
+ import { defineComponent as s, openBlock as a, createElementBlock as r, renderSlot as i } from "vue";
2
2
  const m = /* @__PURE__ */ s({
3
3
  name: "MyButton",
4
4
  __name: "MyButton",
5
5
  emits: ["click"],
6
6
  setup(o, { emit: t }) {
7
- const n = t, e = () => {
7
+ const n = t, c = () => {
8
8
  n("click");
9
9
  };
10
- return (c, u) => (r(), a("button", {
10
+ return (e, u) => (a(), r("button", {
11
11
  class: "my-btn",
12
- onClick: e
12
+ onClick: c
13
13
  }, [
14
- l(c.$slots, "default", {}, void 0, !0)
14
+ i(e.$slots, "default", {}, void 0, !0)
15
15
  ]));
16
16
  }
17
- }), _ = (o, t) => {
17
+ }), l = (o, t) => {
18
18
  const n = o.__vccOpts || o;
19
- for (const [e, c] of t)
20
- n[e] = c;
19
+ for (const [c, e] of t)
20
+ n[c] = e;
21
21
  return n;
22
- }, i = /* @__PURE__ */ _(m, [["__scopeId", "data-v-c654f959"]]), p = [
23
- i
24
- ], d = {
22
+ }, _ = /* @__PURE__ */ l(m, [["__scopeId", "data-v-c654f959"]]), p = /* @__PURE__ */ s({
23
+ name: "MyButton",
24
+ __name: "button2",
25
+ emits: ["click"],
26
+ setup(o, { emit: t }) {
27
+ const n = t, c = () => {
28
+ n("click");
29
+ };
30
+ return (e, u) => (a(), r("button", {
31
+ class: "my-btn",
32
+ onClick: c
33
+ }, [
34
+ i(e.$slots, "default", {}, void 0, !0)
35
+ ]));
36
+ }
37
+ }), d = /* @__PURE__ */ l(p, [["__scopeId", "data-v-1477cfc3"]]);
38
+ class h {
39
+ options;
40
+ constructor(t) {
41
+ this.options = t;
42
+ }
43
+ add(t) {
44
+ this.options.name = t;
45
+ }
46
+ get() {
47
+ return this.options.name;
48
+ }
49
+ }
50
+ const f = [
51
+ _,
52
+ d
53
+ ], y = {
25
54
  install(o) {
26
- p.forEach((t) => {
55
+ f.forEach((t) => {
27
56
  o.component(t.name, t);
28
57
  });
29
58
  }
30
59
  };
31
60
  export {
32
- i as MyButton,
33
- d as default
61
+ d as Button2,
62
+ h as Modbus,
63
+ _ as MyButton,
64
+ y as default
34
65
  };
@@ -1 +1 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["lty-protocol"]={},e.Vue))})(this,(function(e,t){"use strict";const u=((o,n)=>{const c=o.__vccOpts||o;for(const[s,i]of n)c[s]=i;return c})(t.defineComponent({name:"MyButton",__name:"MyButton",emits:["click"],setup(o,{emit:n}){const c=n,s=()=>{c("click")};return(i,_)=>(t.openBlock(),t.createElementBlock("button",{class:"my-btn",onClick:s},[t.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-c654f959"]]),l=[u],r={install(o){l.forEach(n=>{o.component(n.name,n)})}};e.MyButton=u,e.default=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["lty-protocol"]={},n.Vue))})(this,(function(n,t){"use strict";const a=t.defineComponent({name:"MyButton",__name:"MyButton",emits:["click"],setup(o,{emit:e}){const c=e,s=()=>{c("click")};return(i,f)=>(t.openBlock(),t.createElementBlock("button",{class:"my-btn",onClick:s},[t.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),l=(o,e)=>{const c=o.__vccOpts||o;for(const[s,i]of e)c[s]=i;return c},u=l(a,[["__scopeId","data-v-c654f959"]]),r=l(t.defineComponent({name:"MyButton",__name:"button2",emits:["click"],setup(o,{emit:e}){const c=e,s=()=>{c("click")};return(i,f)=>(t.openBlock(),t.createElementBlock("button",{class:"my-btn",onClick:s},[t.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-1477cfc3"]]);class d{options;constructor(e){this.options=e}add(e){this.options.name=e}get(){return this.options.name}}const m=[u,r],_={install(o){m.forEach(e=>{o.component(e.name,e)})}};n.Button2=r,n.Modbus=d,n.MyButton=u,n.default=_,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1 @@
1
+ export * from './modbus';
@@ -0,0 +1,8 @@
1
+ import { IModbus } from '../../types/modbus';
2
+ declare class Modbus {
3
+ options: IModbus;
4
+ constructor(options: IModbus);
5
+ add(name: string): void;
6
+ get(): string;
7
+ }
8
+ export { Modbus };
@@ -0,0 +1 @@
1
+ export * from './modbus';
@@ -0,0 +1,4 @@
1
+ interface IModbus {
2
+ name: string;
3
+ }
4
+ export type { IModbus };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lty-protocol",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "main": "dist/lty-protocol.umd.js",
5
5
  "module": "dist/lty-protocol.mjs",
6
6
  "style": "dist/lty-protocol.css",