nbb-component-ui 1.0.4 → 1.0.5
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.es.js +23 -0
- package/dist/index.umd.js +1 -1
- package/index.js +1 -3
- package/package.json +14 -1
- package/vite.config.js +13 -7
- package/dist/index.css +0 -2
- package/dist/index.mjs +0 -25
- package/src/MyButton.vue +0 -32
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createBlock as e, createTextVNode as t, defineComponent as n, openBlock as r, resolveComponent as i, withCtx as a } from "vue";
|
|
2
|
+
import { ElMessage as o } from "element-plus";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/ProcessFlow/src/ProcessFlow.vue
|
|
5
|
+
var s = /* @__PURE__ */ n({
|
|
6
|
+
__name: "ProcessFlow",
|
|
7
|
+
setup(n) {
|
|
8
|
+
let s = () => {
|
|
9
|
+
o.success("Hello World!");
|
|
10
|
+
};
|
|
11
|
+
return (n, o) => {
|
|
12
|
+
let c = i("el-button");
|
|
13
|
+
return r(), e(c, { onClick: s }, {
|
|
14
|
+
default: a(() => [...o[0] ||= [t("Show message", -1)]]),
|
|
15
|
+
_: 1
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}), c = { install: (e) => {
|
|
20
|
+
e.component("ProcessFlow", s);
|
|
21
|
+
} };
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as ProcessFlow, c as default };
|
package/dist/index.umd.js
CHANGED
|
@@ -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.
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`element-plus`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`element-plus`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.NbbComponentUi={},e.Vue,e.ElementPlus))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=(0,t.defineComponent)({__name:`ProcessFlow`,setup(e){let r=()=>{n.ElMessage.success(`Hello World!`)};return(e,n)=>{let i=(0,t.resolveComponent)(`el-button`);return(0,t.openBlock)(),(0,t.createBlock)(i,{onClick:r},{default:(0,t.withCtx)(()=>[...n[0]||=[(0,t.createTextVNode)(`Show message`,-1)]]),_:1})}}});e.ProcessFlow=r,e.default={install:e=>{e.component(`ProcessFlow`,r)}}});
|
package/index.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import MyButton from './src/MyButton.vue'
|
|
2
1
|
import {ProcessFlow} from "./src/ProcessFlow";
|
|
3
2
|
|
|
4
3
|
// 支持全局注册
|
|
5
4
|
const install = (app) => {
|
|
6
|
-
app.component('MyButton', MyButton)
|
|
7
5
|
app.component('ProcessFlow', ProcessFlow)
|
|
8
6
|
}
|
|
9
7
|
// 支持按需引入
|
|
10
|
-
export {
|
|
8
|
+
export {ProcessFlow }
|
|
11
9
|
// 默认导出(全局注册用)
|
|
12
10
|
export default { install }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nbb-component-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build"
|
|
@@ -11,5 +11,18 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
13
13
|
"vite": "^8.0.3"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"vue": "^3.0.0",
|
|
17
|
+
"element-plus": "^2.0.0"
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"peerDependenciesMeta": {
|
|
21
|
+
"vue": {
|
|
22
|
+
"optional": false
|
|
23
|
+
},
|
|
24
|
+
"element-plus": {
|
|
25
|
+
"optional": false
|
|
26
|
+
}
|
|
14
27
|
}
|
|
15
28
|
}
|
package/vite.config.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
2
|
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
import { resolve } from 'path'
|
|
3
4
|
|
|
4
5
|
export default defineConfig({
|
|
5
6
|
plugins: [vue()],
|
|
6
|
-
|
|
7
7
|
build: {
|
|
8
8
|
lib: {
|
|
9
|
-
entry: 'index.js',
|
|
10
|
-
name: '
|
|
11
|
-
fileName:
|
|
9
|
+
entry: resolve(__dirname, 'index.js'),
|
|
10
|
+
name: 'NbbComponentUi',
|
|
11
|
+
fileName: (format) => `index.${format}.js`,
|
|
12
|
+
formats: ['es', 'umd']
|
|
12
13
|
},
|
|
13
14
|
rollupOptions: {
|
|
14
|
-
|
|
15
|
+
// 【关键】外部化vue和element-plus,不打包进组件库
|
|
16
|
+
external: ['vue', 'element-plus'],
|
|
15
17
|
output: {
|
|
16
|
-
|
|
18
|
+
// UMD模式下的全局变量名
|
|
19
|
+
globals: {
|
|
20
|
+
vue: 'Vue',
|
|
21
|
+
'element-plus': 'ElementPlus'
|
|
22
|
+
}
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
|
-
})
|
|
26
|
+
})
|
package/dist/index.css
DELETED
package/dist/index.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createElementBlock as e, normalizeStyle as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
|
-
var i = /* @__PURE__ */ ((e, t) => {
|
|
3
|
-
let n = e.__vccOpts || e;
|
|
4
|
-
for (let [e, r] of t) n[e] = r;
|
|
5
|
-
return n;
|
|
6
|
-
})({
|
|
7
|
-
__name: "MyButton",
|
|
8
|
-
props: { bgColor: {
|
|
9
|
-
type: String,
|
|
10
|
-
default: "#409eff"
|
|
11
|
-
} },
|
|
12
|
-
emits: ["click"],
|
|
13
|
-
setup(i, { emit: a }) {
|
|
14
|
-
let o = a, s = () => o("click");
|
|
15
|
-
return (a, o) => (n(), e("button", {
|
|
16
|
-
class: "my-btn",
|
|
17
|
-
style: t({ backgroundColor: i.bgColor }),
|
|
18
|
-
onClick: s
|
|
19
|
-
}, [r(a.$slots, "default", {}, void 0, !0)], 4));
|
|
20
|
-
}
|
|
21
|
-
}, [["__scopeId", "data-v-8e812d17"]]), a = { install: (e) => {
|
|
22
|
-
e.component("MyButton", i);
|
|
23
|
-
} };
|
|
24
|
-
//#endregion
|
|
25
|
-
export { i as MyButton, a as default };
|
package/src/MyButton.vue
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button class="my-btn" :style="{ backgroundColor: bgColor }" @click="handleClick">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</button>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup>
|
|
8
|
-
import { defineProps, defineEmits } from 'vue'
|
|
9
|
-
// 定义props
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
bgColor: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: '#409eff'
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
// 定义事件
|
|
17
|
-
const emit = defineEmits(['click'])
|
|
18
|
-
const handleClick = () => {
|
|
19
|
-
console.log('我被点击了')
|
|
20
|
-
emit('click')
|
|
21
|
-
}
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<style scoped>
|
|
25
|
-
.my-btn {
|
|
26
|
-
padding: 8px 16px;
|
|
27
|
-
border: none;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
color: white;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
}
|
|
32
|
-
</style>
|