qxiaoq-vue3 0.0.0
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/es/index.mjs +107 -0
- package/package.json +49 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, toDisplayString } from 'vue';
|
|
2
|
+
|
|
3
|
+
// import { Button } from 'element-ui';
|
|
4
|
+
|
|
5
|
+
// import 'element-ui/lib/theme-chalk/button.css';
|
|
6
|
+
var script = {
|
|
7
|
+
name: 'MyButton',
|
|
8
|
+
|
|
9
|
+
components: {
|
|
10
|
+
// "ElButton":Button
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
label: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'Button'
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'default'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
count: 0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
handleClick() {
|
|
29
|
+
console.log('click');
|
|
30
|
+
this.count++;
|
|
31
|
+
console.log(this.count);
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
// <style src="element-ui/lib/theme-chalk/button.css" scoped></style>
|
|
37
|
+
|
|
38
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
39
|
+
return (openBlock(), createElementBlock("div", null, [
|
|
40
|
+
createElementVNode("button", {
|
|
41
|
+
class: normalizeClass(["btn", $props.type]),
|
|
42
|
+
onClick: _cache[0] || (_cache[0] = (...args) => ($options.handleClick && $options.handleClick(...args)))
|
|
43
|
+
}, toDisplayString($props.label), 3 /* TEXT, CLASS */),
|
|
44
|
+
createCommentVNode(" <ElButton type=\"primary\" @click=\"handleClick\">主要按钮</ElButton> ")
|
|
45
|
+
]))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function styleInject(css, ref) {
|
|
49
|
+
if ( ref === void 0 ) ref = {};
|
|
50
|
+
var insertAt = ref.insertAt;
|
|
51
|
+
|
|
52
|
+
if (typeof document === 'undefined') { return; }
|
|
53
|
+
|
|
54
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
55
|
+
var style = document.createElement('style');
|
|
56
|
+
style.type = 'text/css';
|
|
57
|
+
|
|
58
|
+
if (insertAt === 'top') {
|
|
59
|
+
if (head.firstChild) {
|
|
60
|
+
head.insertBefore(style, head.firstChild);
|
|
61
|
+
} else {
|
|
62
|
+
head.appendChild(style);
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
head.appendChild(style);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (style.styleSheet) {
|
|
69
|
+
style.styleSheet.cssText = css;
|
|
70
|
+
} else {
|
|
71
|
+
style.appendChild(document.createTextNode(css));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var css_248z = "\n.btn[data-v-9817d0e8] {\r\n padding: 10px 20px;\r\n border: none;\r\n cursor: pointer;\n}\n.btn.default[data-v-9817d0e8] {\r\n /* background-color: #fff; */\r\n background-color: #ecafaf;\r\n color: #333;\n}\n.btn.primary[data-v-9817d0e8] {\r\n background-color: #007bff;\r\n color: #fff;\n}\r\n";
|
|
76
|
+
styleInject(css_248z);
|
|
77
|
+
|
|
78
|
+
script.render = render;
|
|
79
|
+
script.__scopeId = "data-v-9817d0e8";
|
|
80
|
+
script.__file = "packages/components/button/src/main.vue";
|
|
81
|
+
|
|
82
|
+
script.install = function (Vue) {
|
|
83
|
+
Vue.component(script.name, script);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const components = [
|
|
87
|
+
script,
|
|
88
|
+
];
|
|
89
|
+
const install = function (Vue) {
|
|
90
|
+
if (install.installed) return;
|
|
91
|
+
install.installed = true;
|
|
92
|
+
// 遍历并注册全局组件
|
|
93
|
+
components.map(component => {
|
|
94
|
+
Vue.component(component.name, component);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
98
|
+
install(window.Vue);
|
|
99
|
+
}
|
|
100
|
+
// export default QxiaoqUI;
|
|
101
|
+
var index = {
|
|
102
|
+
install,
|
|
103
|
+
MyButton: script,
|
|
104
|
+
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { index as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "qxiaoq-vue3",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/lib/index.js",
|
|
6
|
+
"module": "dist/es/index.mjs",
|
|
7
|
+
"types": "dist/es/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"build": "rollup -c",
|
|
13
|
+
|
|
14
|
+
"publish": "npm run build && npm publish",
|
|
15
|
+
"prepublish": "npm config set registry https://registry.npmjs.org/ ",
|
|
16
|
+
"postpublish": "npm config set registry https://registry.npmmirror.com/ "
|
|
17
|
+
},
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./dist/es/index.mjs",
|
|
23
|
+
"require": "./dist/lib/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./es": {
|
|
26
|
+
"import": "./dist/es/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./lib": {
|
|
29
|
+
"require": "./dist/lib/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist/*"
|
|
34
|
+
],
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@vitejs/plugin-vue": "^5.2.2",
|
|
37
|
+
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
|
38
|
+
"rollup": "^4.35.0",
|
|
39
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
40
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
41
|
+
"unbuild": "^3.5.0",
|
|
42
|
+
"vite": "^6.2.2",
|
|
43
|
+
"vue": "^3.5.13",
|
|
44
|
+
"vue-tsc": "^3.0.0-alpha.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"vue": "^3.5.13"
|
|
48
|
+
}
|
|
49
|
+
}
|