hel-test-vue3-comp-esm-lib 1.5.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/README.md +9 -0
- package/hel_dist/assets/index-CHXtSHf9.js +25 -0
- package/hel_dist/assets/index-CHXtSHf9.js.map +1 -0
- package/hel_dist/assets/index-FuFGqtaw.js +2 -0
- package/hel_dist/assets/index-FuFGqtaw.js.map +1 -0
- package/hel_dist/assets/index-xAurhbX9.css +1 -0
- package/hel_dist/assets/libProperties-DGTH5IvI.js +2 -0
- package/hel_dist/assets/libProperties-DGTH5IvI.js.map +1 -0
- package/hel_dist/assets/loadApp-BWZ2bSto.js +2226 -0
- package/hel_dist/assets/loadApp-BWZ2bSto.js.map +1 -0
- package/hel_dist/assets/loadApp-ht98S9XG.css +1 -0
- package/hel_dist/entry.js +37 -0
- package/hel_dist/favicon.ico +0 -0
- package/hel_dist/hel-meta.json +73 -0
- package/hel_dist/index.html +23 -0
- package/hel_proxy/entry.js +37 -0
- package/hel_proxy_es/entry.js +28 -0
- package/package.json +68 -0
- package/scripts/buildCI.cjs +14 -0
- package/scripts/check.cjs +13 -0
- package/scripts/meta.cjs +22 -0
- package/scripts/prepublishOnly.cjs +25 -0
- package/src/assets/logo.png +0 -0
- package/src/components/App.vue +256 -0
- package/src/components/HelloWorld.vue +31 -0
- package/src/components/button.vue +41 -0
- package/src/components/dialog.vue +50 -0
- package/src/components/index.js +20 -0
- package/src/components/tooltip.vue +61 -0
- package/src/configs/subApp.js +9 -0
- package/src/entrance/libProperties.js +10 -0
- package/src/entrance/libTypes.ts +28 -0
- package/src/loadApp.js +17 -0
- package/src/main.js +15 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="visible" class="wrapperStyle">
|
|
3
|
+
<div class="boxStyle">
|
|
4
|
+
<div>
|
|
5
|
+
<p>What is your name ?</p>
|
|
6
|
+
<input :style="{ fontSize: '18px', lineHeight: 2 }" type="text" />
|
|
7
|
+
</div>
|
|
8
|
+
<button :style="{ marginTop: '10px' }" @click="switchVisible(false)">
|
|
9
|
+
close It!
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
visible: {
|
|
18
|
+
default: true,
|
|
19
|
+
type: Boolean,
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const emit = defineEmits(['switchVisible']);
|
|
24
|
+
|
|
25
|
+
const switchVisible = (flag) => {
|
|
26
|
+
emit('switchVisible', flag);
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style lang="css" scoped>
|
|
31
|
+
.wrapperStyle {
|
|
32
|
+
position: fixed;
|
|
33
|
+
top: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
bottom: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
z-index: 2000;
|
|
38
|
+
height: 100%;
|
|
39
|
+
background-color: rgba(0,0,0,.5);
|
|
40
|
+
overflow: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.boxStyle {
|
|
44
|
+
width: 30%;
|
|
45
|
+
margin: 0 auto 50px;
|
|
46
|
+
margin-top: 15vh;
|
|
47
|
+
padding: 20px;
|
|
48
|
+
background: #fff;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 这些组件暴露给使用方
|
|
5
|
+
|
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import App from './App.vue';
|
|
9
|
+
import HelloWorld from './HelloWorld.vue';
|
|
10
|
+
import Button from './button.vue';
|
|
11
|
+
import Dialog from './dialog.vue';
|
|
12
|
+
import Tooltip from './tooltip.vue';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
App,
|
|
16
|
+
HelloWorld,
|
|
17
|
+
Button,
|
|
18
|
+
Dialog,
|
|
19
|
+
Tooltip,
|
|
20
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tool-tip" :data-content="message">
|
|
3
|
+
{{ content }}
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
defineProps({
|
|
9
|
+
message: {
|
|
10
|
+
default: "",
|
|
11
|
+
type: String,
|
|
12
|
+
},
|
|
13
|
+
content: {
|
|
14
|
+
default: "",
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.tool-tip {
|
|
22
|
+
background-color: #fff;
|
|
23
|
+
padding: 10px 16px;
|
|
24
|
+
border: 1px solid #dcdfe6;
|
|
25
|
+
display: inline-block;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
/* content-box */
|
|
31
|
+
.tool-tip::before {
|
|
32
|
+
content: attr(data-content);
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
position: absolute;
|
|
36
|
+
background-color: #303133;
|
|
37
|
+
color: #fff;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
padding: 10px;
|
|
41
|
+
left: 50%;
|
|
42
|
+
bottom: 100%;
|
|
43
|
+
transform: translate(-50%, -10px);
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
/* arrow-box */
|
|
47
|
+
.tool-tip::after {
|
|
48
|
+
display: none;
|
|
49
|
+
content: "";
|
|
50
|
+
border: 6px solid transparent;
|
|
51
|
+
border-top-color: #303133;
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 50%;
|
|
54
|
+
bottom: 100%;
|
|
55
|
+
transform: translate(-50%, 2px);
|
|
56
|
+
}
|
|
57
|
+
.tool-tip:hover::after,
|
|
58
|
+
.tool-tip:hover::before {
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 组件类型导出文件,同时也作为 rollup 的打包入口文件,因只提供类型,rollup 打包后是一个
|
|
5
|
+
| 仅包含 hel-lib-proxy 的空壳文件,对模块使用方的包体构建大小无影响
|
|
6
|
+
| 模块使用方 通过 npm i xxx-lib 后,只要在头文件处执行过 preFetchLib
|
|
7
|
+
| 则整个项目项使用本地模块一样载入提供方的组件,并可以点击到 node_modules 查看源码
|
|
8
|
+
|
|
|
9
|
+
|--------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import { exposeLib } from 'hel-lib-proxy';
|
|
12
|
+
import { LIB_NAME } from '../configs/subApp';
|
|
13
|
+
|
|
14
|
+
export type CompTypes = {
|
|
15
|
+
App: {
|
|
16
|
+
name: string,
|
|
17
|
+
},
|
|
18
|
+
HelloWorld: {
|
|
19
|
+
name: string,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 将提供给用户的lib暴露出去(同时也暴露了类型)
|
|
25
|
+
*/
|
|
26
|
+
export const dtlib = exposeLib<CompTypes>(LIB_NAME);
|
|
27
|
+
|
|
28
|
+
export default dtlib;
|
package/src/loadApp.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 用于本地调试组件,配合环境变量 VITE_COMP 参数来决定载入哪个组件调试
|
|
5
|
+
|
|
|
6
|
+
|--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { createApp } from 'vue';
|
|
9
|
+
import TDesign from 'tdesign-vue-next';
|
|
10
|
+
import 'tdesign-vue-next/es/style/index.css';
|
|
11
|
+
import libProperties from './entrance/libProperties';
|
|
12
|
+
|
|
13
|
+
const compName = import.meta.env.VITE_COMP || 'App';
|
|
14
|
+
|
|
15
|
+
const app = createApp(libProperties[compName]);
|
|
16
|
+
app.use(TDesign);
|
|
17
|
+
app.mount('#app');
|
package/src/main.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isMasterApp } from 'hel-iso';
|
|
2
|
+
import { libReady } from 'hel-lib-proxy';
|
|
3
|
+
import { LIB_NAME } from './configs/subApp';
|
|
4
|
+
|
|
5
|
+
(async function () {
|
|
6
|
+
const libProperties = await import('./entrance/libProperties');
|
|
7
|
+
// 注意此处传递的是 default
|
|
8
|
+
libReady(LIB_NAME, libProperties.default);
|
|
9
|
+
|
|
10
|
+
// 非子应用时(即不是被别的模块触发载入的情况),自己挂载渲染节点,方便本地调试
|
|
11
|
+
// 可根据项目实际情况控制是否载入 loadApp 文件
|
|
12
|
+
if (isMasterApp()) {
|
|
13
|
+
await import('./loadApp');
|
|
14
|
+
}
|
|
15
|
+
})().catch(console.error);
|