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 +25 -20
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +49 -1
- package/dist/index.umd.js.map +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { openBlock
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
for (const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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(
|
|
19
|
-
const
|
|
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
|
|
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
|
|
36
|
-
return
|
|
37
|
-
onClick:
|
|
38
|
-
}, " aaaaa=" +
|
|
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
|
|
44
|
+
const test = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
41
45
|
export {
|
|
42
|
-
|
|
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(
|
|
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;;;;"}
|