suncy-my-npm-test 1.0.43 → 1.0.44
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 +56 -49
- package/packages/components/MyButton.vue +76 -0
- package/packages/index.js +27 -0
- package/dist/index.esm.js +0 -32
- package/dist/index.esm.js.map +0 -1
- package/dist/index.umd.js +0 -34
- package/dist/index.umd.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,49 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "suncy-my-npm-test",
|
|
3
|
+
"version": "1.0.44",
|
|
4
|
+
"description": "A Vue2 component library",
|
|
5
|
+
"main": "lib/suncy-my-npm-test.umd.min.js",
|
|
6
|
+
"module": "lib/suncy-my-npm-test.esm.js",
|
|
7
|
+
"unpkg": "lib/suncy-my-npm-test.umd.min.js",
|
|
8
|
+
"jsdelivr": "lib/suncy-my-npm-test.umd.min.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib",
|
|
11
|
+
"packages"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"serve": "vue-cli-service serve",
|
|
15
|
+
"build": "vue-cli-service build",
|
|
16
|
+
"build:lib": "vue-cli-service build --target lib --name suncy-my-npm-test ./packages/index.js",
|
|
17
|
+
"lint": "vue-cli-service lint",
|
|
18
|
+
"prepublishOnly": "npm run build:lib"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"core-js": "^3.8.3",
|
|
22
|
+
"vue": "^2.6.14"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@vue/cli-plugin-babel": "~5.0.8",
|
|
26
|
+
"@vue/cli-service": "~5.0.8",
|
|
27
|
+
"vue-template-compiler": "^2.6.14",
|
|
28
|
+
"sass": "^1.32.7",
|
|
29
|
+
"sass-loader": "^12.0.0",
|
|
30
|
+
"eslint": "^8.7.0",
|
|
31
|
+
"eslint-plugin-vue": "^8.4.1"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"vue": "^2.6.0"
|
|
35
|
+
},
|
|
36
|
+
"browserslist": [
|
|
37
|
+
"> 1%",
|
|
38
|
+
"last 2 versions",
|
|
39
|
+
"not dead"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"vue2",
|
|
43
|
+
"component",
|
|
44
|
+
"library"
|
|
45
|
+
],
|
|
46
|
+
"author": "Your Name",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/yourname/suncy-my-npm-test.git"
|
|
51
|
+
},
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/yourname/suncy-my-npm-test/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/yourname/suncy-my-npm-test#readme"
|
|
56
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="my-button"
|
|
4
|
+
:class="[typeClass, sizeClass]"
|
|
5
|
+
@click="$emit('click')"
|
|
6
|
+
>
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</button>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'MyButton',
|
|
14
|
+
props: {
|
|
15
|
+
type: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'default',
|
|
18
|
+
validator: (value) => ['default', 'primary', 'success', 'warning', 'danger'].includes(value)
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'medium',
|
|
23
|
+
validator: (value) => ['small', 'medium', 'large'].includes(value)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
typeClass() {
|
|
28
|
+
return `my-button--${this.type}`
|
|
29
|
+
},
|
|
30
|
+
sizeClass() {
|
|
31
|
+
return `my-button--${this.size}`
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.my-button {
|
|
39
|
+
padding: 10px 20px;
|
|
40
|
+
border: none;
|
|
41
|
+
border-radius: 4px;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
transition: all 0.3s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.my-button--default {
|
|
48
|
+
background: #f0f0f0;
|
|
49
|
+
color: #333;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.my-button--primary {
|
|
53
|
+
background: #409eff;
|
|
54
|
+
color: white;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.my-button--success {
|
|
58
|
+
background: #67c23a;
|
|
59
|
+
color: white;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.my-button--small {
|
|
63
|
+
padding: 8px 16px;
|
|
64
|
+
font-size: 12px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.my-button--medium {
|
|
68
|
+
padding: 10px 20px;
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.my-button--large {
|
|
73
|
+
padding: 12px 24px;
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import MyButton from './components/MyButton.vue'
|
|
2
|
+
|
|
3
|
+
const components = {
|
|
4
|
+
MyButton,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const install = function(Vue) {
|
|
8
|
+
if (install.installed) return
|
|
9
|
+
|
|
10
|
+
Object.keys(components).forEach(key => {
|
|
11
|
+
Vue.component(components[key].name, components[key])
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 自动安装
|
|
16
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
17
|
+
install(window.Vue)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
install,
|
|
22
|
+
...components
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
MyButton,
|
|
27
|
+
}
|
package/dist/index.esm.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, toDisplayString } from "vue";
|
|
2
|
-
const _export_sfc = (sfc, props) => {
|
|
3
|
-
const target = sfc.__vccOpts || sfc;
|
|
4
|
-
for (const [key, val] of props) {
|
|
5
|
-
target[key] = val;
|
|
6
|
-
}
|
|
7
|
-
return target;
|
|
8
|
-
};
|
|
9
|
-
const _sfc_main = {
|
|
10
|
-
name: "MyComponent",
|
|
11
|
-
data() {
|
|
12
|
-
return {
|
|
13
|
-
count: 0
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
methods: {
|
|
17
|
-
handleClick() {
|
|
18
|
-
this.count++;
|
|
19
|
-
this.$emit("click", this.count);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
24
|
-
return openBlock(), createElementBlock("div", {
|
|
25
|
-
onClick: _cache[0] || (_cache[0] = (...args) => $options.handleClick && $options.handleClick(...args))
|
|
26
|
-
}, " aaaaa=" + toDisplayString($data.count), 1);
|
|
27
|
-
}
|
|
28
|
-
const test = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
29
|
-
export {
|
|
30
|
-
test as default
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 export default {\r\n name: 'MyComponent',\r\n data() {\r\n return {\r\n count: 0\r\n }\r\n },\r\n methods: {\r\n handleClick() {\r\n this.count++\r\n this.$emit('click', this.count)\r\n }\r\n }\r\n }\r\n </script>\r\n "],"names":["_createElementBlock"],"mappings":";;;;;;;;AAME,MAAK,YAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AACL,WAAO;AAAA,MACL,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,cAAc;AACZ,WAAK;AACL,WAAK,MAAM,SAAS,KAAK,KAAK;AAAA,IAChC;AAAA,EACF;AACF;;sBAlBEA,mBAEM,OAAA;AAAA,IAFA,gDAAO,SAAA,eAAA,SAAA,YAAA,GAAA,IAAA;AAAA,EAAa,GAAA,4BACd,MAAA,KAAK,GAAA,CAAA;;;"}
|
package/dist/index.umd.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue")) : typeof define === "function" && define.amd ? define(["vue"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, global.MyTest = factory(global.Vue));
|
|
3
|
-
})(this, (function(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 = {
|
|
13
|
-
name: "MyComponent",
|
|
14
|
-
data() {
|
|
15
|
-
return {
|
|
16
|
-
count: 0
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
methods: {
|
|
20
|
-
handleClick() {
|
|
21
|
-
this.count++;
|
|
22
|
-
this.$emit("click", this.count);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
27
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
28
|
-
onClick: _cache[0] || (_cache[0] = (...args) => $options.handleClick && $options.handleClick(...args))
|
|
29
|
-
}, " aaaaa=" + vue.toDisplayString($data.count), 1);
|
|
30
|
-
}
|
|
31
|
-
const test = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
32
|
-
return test;
|
|
33
|
-
}));
|
|
34
|
-
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 export default {\r\n name: 'MyComponent',\r\n data() {\r\n return {\r\n count: 0\r\n }\r\n },\r\n methods: {\r\n handleClick() {\r\n this.count++\r\n this.$emit('click', this.count)\r\n }\r\n }\r\n }\r\n </script>\r\n "],"names":["_createElementBlock"],"mappings":";;;;;;;;;;;AAME,QAAK,YAAU;AAAA,IACb,MAAM;AAAA,IACN,OAAO;AACL,aAAO;AAAA,QACL,OAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,cAAc;AACZ,aAAK;AACL,aAAK,MAAM,SAAS,KAAK,KAAK;AAAA,MAChC;AAAA,IACF;AAAA,EACF;;4BAlBEA,IAAAA,mBAEM,OAAA;AAAA,MAFA,gDAAO,SAAA,eAAA,SAAA,YAAA,GAAA,IAAA;AAAA,IAAa,GAAA,gCACd,MAAA,KAAK,GAAA,CAAA;AAAA;;;;"}
|