suncy-my-npm-test 1.0.3 → 1.0.4

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/index.esm.js CHANGED
@@ -1,11 +1,13 @@
1
- import { defineComponent as r, ref as i } from "vue-demi";
2
- import { openBlock as s, createElementBlock as a, toDisplayString as p } from "vue";
3
- const k = (t, n) => {
4
- const e = t.__vccOpts || t;
5
- for (const [o, c] of n)
6
- e[o] = c;
7
- return e;
8
- }, m = r({
1
+ import { defineComponent, ref } from "vue-demi";
2
+ import { openBlock, createElementBlock, toDisplayString } from "vue";
3
+ const _export_sfc = (sfc, props) => {
4
+ const target = sfc.__vccOpts || sfc;
5
+ for (const [key, val] of props) {
6
+ target[key] = val;
7
+ }
8
+ return target;
9
+ };
10
+ const _sfc_main = defineComponent({
9
11
  name: "MyComponent",
10
12
  props: {
11
13
  label: {
@@ -15,13 +17,15 @@ const k = (t, n) => {
15
17
  },
16
18
  emits: ["click"],
17
19
  // Vue3 的 emits,Vue2 会自动忽略
18
- setup(t, { emit: n }) {
19
- const e = i(0);
20
+ setup(props, { emit }) {
21
+ const count = ref(0);
22
+ const handleClick = () => {
23
+ count.value++;
24
+ emit("click", count.value);
25
+ };
20
26
  return {
21
- count: e,
22
- handleClick: () => {
23
- e.value++, n("click", e.value);
24
- }
27
+ count,
28
+ handleClick
25
29
  };
26
30
  },
27
31
  // Vue2 选项式 API 兼容
@@ -32,12 +36,13 @@ const k = (t, n) => {
32
36
  }
33
37
  }
34
38
  });
35
- function u(t, n, e, o, c, d) {
36
- return s(), a("div", {
37
- onClick: n[0] || (n[0] = (...l) => t.handleClick && t.handleClick(...l))
38
- }, " aaaaa=" + p(t.count), 1);
39
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
40
+ return openBlock(), createElementBlock("div", {
41
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
42
+ }, " aaaaa=" + toDisplayString(_ctx.count), 1);
39
43
  }
40
- const h = /* @__PURE__ */ k(m, [["render", u]]);
44
+ const test = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
41
45
  export {
42
- h as default
46
+ test as default
43
47
  };
48
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/test.vue"],"sourcesContent":["<template>\r\n <div @click=\"handleClick\">\r\n aaaaa={{count}}\r\n </div>\r\n </template>\r\n <script>\r\n import { defineComponent, ref } from 'vue-demi'\r\n\r\n export default defineComponent({\r\n name: 'MyComponent',\r\n \r\n props: {\r\n label: {\r\n type: String,\r\n default: 'Click me'\r\n }\r\n },\r\n \r\n emits: ['click'], // Vue3 的 emits,Vue2 会自动忽略\r\n \r\n setup(props, { emit }) {\r\n const count = ref(0)\r\n \r\n const handleClick = () => {\r\n count.value++\r\n emit('click', count.value)\r\n }\r\n \r\n return {\r\n count,\r\n handleClick\r\n }\r\n },\r\n \r\n // Vue2 选项式 API 兼容\r\n methods: {\r\n // 如果需要支持 Vue2 的 $emit 调用\r\n onClick() {\r\n this.$emit('click', this.count)\r\n }\r\n }\r\n})\r\n </script>\r\n "],"names":["_createElementBlock"],"mappings":";;;;;;;;;AAQE,MAAK,YAAa,gBAAa;AAAA,EAC/B,MAAM;AAAA,EAEN,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;EAGF,OAAO,CAAC,OAAO;AAAA;AAAA,EAEf,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,QAAQ,IAAI,CAAC;AAEnB,UAAM,cAAc,MAAM;AACxB,YAAM;AACN,WAAK,SAAS,MAAM,KAAK;AAAA,IAC3B;AAEA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAGA,SAAS;AAAA;AAAA,IAEP,UAAU;AACR,WAAK,MAAM,SAAS,KAAK,KAAK;AAAA,IAChC;AAAA,EACF;AACF,CAAC;;sBAxCGA,mBAEM,OAAA;AAAA,IAFA,gDAAO,KAAA,eAAA,KAAA,YAAA,GAAA,IAAA;AAAA,EAAa,GAAA,4BACd,KAAA,KAAK,GAAA,CAAA;;;"}
package/dist/index.umd.js CHANGED
@@ -1 +1,49 @@
1
- (function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t(require("vue-demi"),require("vue")):typeof define=="function"&&define.amd?define(["vue-demi","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,e.MyTest=t(e.VueDemi,e.Vue))})(this,(function(e,t){"use strict";const r=(n,o)=>{const i=n.__vccOpts||n;for(const[s,c]of o)i[s]=c;return i},u=e.defineComponent({name:"MyComponent",props:{label:{type:String,default:"Click me"}},emits:["click"],setup(n,{emit:o}){const i=e.ref(0);return{count:i,handleClick:()=>{i.value++,o("click",i.value)}}},methods:{onClick(){this.$emit("click",this.count)}}});function d(n,o,i,s,c,f){return t.openBlock(),t.createElementBlock("div",{onClick:o[0]||(o[0]=(...l)=>n.handleClick&&n.handleClick(...l))}," aaaaa="+t.toDisplayString(n.count),1)}return r(u,[["render",d]])}));
1
+ (function(global, factory) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue-demi"), require("vue")) : typeof define === "function" && define.amd ? define(["vue-demi", "vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.MyTest = factory(global.VueDemi, global.Vue));
3
+ })(this, (function(vueDemi, vue) {
4
+ "use strict";
5
+ const _export_sfc = (sfc, props) => {
6
+ const target = sfc.__vccOpts || sfc;
7
+ for (const [key, val] of props) {
8
+ target[key] = val;
9
+ }
10
+ return target;
11
+ };
12
+ const _sfc_main = vueDemi.defineComponent({
13
+ name: "MyComponent",
14
+ props: {
15
+ label: {
16
+ type: String,
17
+ default: "Click me"
18
+ }
19
+ },
20
+ emits: ["click"],
21
+ // Vue3 的 emits,Vue2 会自动忽略
22
+ setup(props, { emit }) {
23
+ const count = vueDemi.ref(0);
24
+ const handleClick = () => {
25
+ count.value++;
26
+ emit("click", count.value);
27
+ };
28
+ return {
29
+ count,
30
+ handleClick
31
+ };
32
+ },
33
+ // Vue2 选项式 API 兼容
34
+ methods: {
35
+ // 如果需要支持 Vue2 的 $emit 调用
36
+ onClick() {
37
+ this.$emit("click", this.count);
38
+ }
39
+ }
40
+ });
41
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
42
+ return vue.openBlock(), vue.createElementBlock("div", {
43
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
44
+ }, " aaaaa=" + vue.toDisplayString(_ctx.count), 1);
45
+ }
46
+ const test = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
47
+ return test;
48
+ }));
49
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/test.vue"],"sourcesContent":["<template>\r\n <div @click=\"handleClick\">\r\n aaaaa={{count}}\r\n </div>\r\n </template>\r\n <script>\r\n import { defineComponent, ref } from 'vue-demi'\r\n\r\n export default defineComponent({\r\n name: 'MyComponent',\r\n \r\n props: {\r\n label: {\r\n type: String,\r\n default: 'Click me'\r\n }\r\n },\r\n \r\n emits: ['click'], // Vue3 的 emits,Vue2 会自动忽略\r\n \r\n setup(props, { emit }) {\r\n const count = ref(0)\r\n \r\n const handleClick = () => {\r\n count.value++\r\n emit('click', count.value)\r\n }\r\n \r\n return {\r\n count,\r\n handleClick\r\n }\r\n },\r\n \r\n // Vue2 选项式 API 兼容\r\n methods: {\r\n // 如果需要支持 Vue2 的 $emit 调用\r\n onClick() {\r\n this.$emit('click', this.count)\r\n }\r\n }\r\n})\r\n </script>\r\n "],"names":["defineComponent","ref","_createElementBlock"],"mappings":";;;;;;;;;;;AAQE,QAAK,YAAaA,QAAAA,gBAAa;AAAA,IAC/B,MAAM;AAAA,IAEN,OAAO;AAAA,MACL,OAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA;IAGF,OAAO,CAAC,OAAO;AAAA;AAAA,IAEf,MAAM,OAAO,EAAE,QAAQ;AACrB,YAAM,QAAQC,QAAAA,IAAI,CAAC;AAEnB,YAAM,cAAc,MAAM;AACxB,cAAM;AACN,aAAK,SAAS,MAAM,KAAK;AAAA,MAC3B;AAEA,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA;AAAA,IAGA,SAAS;AAAA;AAAA,MAEP,UAAU;AACR,aAAK,MAAM,SAAS,KAAK,KAAK;AAAA,MAChC;AAAA,IACF;AAAA,EACF,CAAC;;4BAxCGC,IAAAA,mBAEM,OAAA;AAAA,MAFA,gDAAO,KAAA,eAAA,KAAA,YAAA,GAAA,IAAA;AAAA,IAAa,GAAA,gCACd,KAAA,KAAK,GAAA,CAAA;AAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suncy-my-npm-test",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "description": "A Vue component compatible with Vue 2 & 3",
6
6
  "main": "dist/index.umd.js",