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.
@@ -0,0 +1,37 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('hel-lib-proxy')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'hel-lib-proxy'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["components-lib"] = {}, global.helLibProxy));
5
+ })(this, (function (exports, helLibProxy) { 'use strict';
6
+
7
+ /*
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | 对应 package.json/appGroupName
11
+ |
12
+ |--------------------------------------------------------------------------
13
+ */
14
+
15
+ const LIB_NAME = 'components-lib';
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ |
20
+ | 组件类型导出文件,同时也作为 rollup 的打包入口文件,因只提供类型,rollup 打包后是一个
21
+ | 仅包含 hel-lib-proxy 的空壳文件,对模块使用方的包体构建大小无影响
22
+ | 模块使用方 通过 npm i xxx-lib 后,只要在头文件处执行过 preFetchLib
23
+ | 则整个项目项使用本地模块一样载入提供方的组件,并可以点击到 node_modules 查看源码
24
+ |
25
+ |--------------------------------------------------------------------------
26
+ */
27
+ /**
28
+ * 将提供给用户的lib暴露出去(同时也暴露了类型)
29
+ */
30
+ var dtlib = helLibProxy.exposeLib(LIB_NAME);
31
+
32
+ exports.default = dtlib;
33
+ exports.dtlib = dtlib;
34
+
35
+ Object.defineProperty(exports, '__esModule', { value: true });
36
+
37
+ }));
Binary file
@@ -0,0 +1,73 @@
1
+ {
2
+ "app": {
3
+ "name": "components-lib",
4
+ "app_group_name": "components-lib",
5
+ "git_repo_url": "",
6
+ "online_version": "1.5.0",
7
+ "build_version": "1.5.0",
8
+ "platform": "unpkg",
9
+ "create_at": "2026-01-24T09:28:45.452Z"
10
+ },
11
+ "version": {
12
+ "plugin_ver": "5.4.3",
13
+ "extract_mode": "build",
14
+ "sub_app_name": "components-lib",
15
+ "sub_app_version": "components-lib@1.5.0",
16
+ "version_tag": "1.5.0",
17
+ "src_map": {
18
+ "webDirPath": "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist",
19
+ "htmlIndexSrc": "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/index.html",
20
+ "extractMode": "all",
21
+ "iframeSrc": "",
22
+ "chunkCssSrcList": [
23
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/index-xAurhbX9.css",
24
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/loadApp-ht98S9XG.css"
25
+ ],
26
+ "chunkJsSrcList": [
27
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/index-CHXtSHf9.js",
28
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/index-FuFGqtaw.js",
29
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/libProperties-DGTH5IvI.js",
30
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/loadApp-BWZ2bSto.js"
31
+ ],
32
+ "staticCssSrcList": [],
33
+ "staticJsSrcList": [],
34
+ "relativeCssSrcList": [],
35
+ "relativeJsSrcList": [
36
+ "./assets/index-CHXtSHf9.js"
37
+ ],
38
+ "headAssetList": [
39
+ {
40
+ "tag": "script",
41
+ "append": true,
42
+ "attrs": {
43
+ "type": "importmap"
44
+ },
45
+ "innerText": "\n {\n \"imports\": {\n \"vue\": \"https://unpkg.com/vue@3/dist/vue.esm-browser.js\"\n }\n }\n "
46
+ },
47
+ {
48
+ "tag": "relativeScript",
49
+ "append": false,
50
+ "attrs": {
51
+ "src": "./assets/index-CHXtSHf9.js",
52
+ "type": "module",
53
+ "crossorigin": ""
54
+ }
55
+ }
56
+ ],
57
+ "bodyAssetList": [],
58
+ "otherSrcList": [
59
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/index-CHXtSHf9.js.map",
60
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/index-FuFGqtaw.js.map",
61
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/libProperties-DGTH5IvI.js.map",
62
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/assets/loadApp-BWZ2bSto.js.map",
63
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/favicon.ico",
64
+ "http://localhost:3000/lib/comp/hel-test-vue3-comp-esm-lib@1.5.0/hel_dist/index.html"
65
+ ],
66
+ "srvModSrcList": [],
67
+ "srvModSrcIndex": ""
68
+ },
69
+ "html_content": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>tpl-remote-vue-comp</title>\n <!-- Vue3 CDN -->\n <!-- <script src=\"https://unpkg.com/vue@3/dist/vue.global.js\"></script> -->\n <!-- importmap for vue3 -->\n\n <script type=\"importmap\">\n {\n \"imports\": {\n \"vue\": \"https://unpkg.com/vue@3/dist/vue.esm-browser.js\"\n }\n }\n </script>\n <script type=\"module\" crossorigin src=\"./assets/index-CHXtSHf9.js\"></script>\n</head>\n<body>\n <div id=\"app\"></div>\n</body>\n</html>\n",
70
+ "create_at": "2026-01-24T09:28:45.452Z",
71
+ "desc": "this version meta is created by hel-dev-utils@5.4.3"
72
+ }
73
+ }
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>tpl-remote-vue-comp</title>
7
+ <!-- Vue3 CDN -->
8
+ <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
9
+ <!-- importmap for vue3 -->
10
+
11
+ <script type="importmap">
12
+ {
13
+ "imports": {
14
+ "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
15
+ }
16
+ }
17
+ </script>
18
+ <script type="module" crossorigin src="./assets/index-CHXtSHf9.js"></script>
19
+ </head>
20
+ <body>
21
+ <div id="app"></div>
22
+ </body>
23
+ </html>
@@ -0,0 +1,37 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('hel-lib-proxy')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'hel-lib-proxy'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["components-lib"] = {}, global.helLibProxy));
5
+ })(this, (function (exports, helLibProxy) { 'use strict';
6
+
7
+ /*
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | 对应 package.json/appGroupName
11
+ |
12
+ |--------------------------------------------------------------------------
13
+ */
14
+
15
+ const LIB_NAME = 'components-lib';
16
+
17
+ /*
18
+ |--------------------------------------------------------------------------
19
+ |
20
+ | 组件类型导出文件,同时也作为 rollup 的打包入口文件,因只提供类型,rollup 打包后是一个
21
+ | 仅包含 hel-lib-proxy 的空壳文件,对模块使用方的包体构建大小无影响
22
+ | 模块使用方 通过 npm i xxx-lib 后,只要在头文件处执行过 preFetchLib
23
+ | 则整个项目项使用本地模块一样载入提供方的组件,并可以点击到 node_modules 查看源码
24
+ |
25
+ |--------------------------------------------------------------------------
26
+ */
27
+ /**
28
+ * 将提供给用户的lib暴露出去(同时也暴露了类型)
29
+ */
30
+ var dtlib = helLibProxy.exposeLib(LIB_NAME);
31
+
32
+ exports.default = dtlib;
33
+ exports.dtlib = dtlib;
34
+
35
+ Object.defineProperty(exports, '__esModule', { value: true });
36
+
37
+ }));
@@ -0,0 +1,28 @@
1
+ import { exposeLib } from 'hel-lib-proxy';
2
+
3
+ /*
4
+ |--------------------------------------------------------------------------
5
+ |
6
+ | 对应 package.json/appGroupName
7
+ |
8
+ |--------------------------------------------------------------------------
9
+ */
10
+
11
+ const LIB_NAME = 'components-lib';
12
+
13
+ /*
14
+ |--------------------------------------------------------------------------
15
+ |
16
+ | 组件类型导出文件,同时也作为 rollup 的打包入口文件,因只提供类型,rollup 打包后是一个
17
+ | 仅包含 hel-lib-proxy 的空壳文件,对模块使用方的包体构建大小无影响
18
+ | 模块使用方 通过 npm i xxx-lib 后,只要在头文件处执行过 preFetchLib
19
+ | 则整个项目项使用本地模块一样载入提供方的组件,并可以点击到 node_modules 查看源码
20
+ |
21
+ |--------------------------------------------------------------------------
22
+ */
23
+ /**
24
+ * 将提供给用户的lib暴露出去(同时也暴露了类型)
25
+ */
26
+ var dtlib = exposeLib(LIB_NAME);
27
+
28
+ export { dtlib as default, dtlib };
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "hel-test-vue3-comp-esm-lib",
3
+ "appGroupName": "components-lib",
4
+ "main": "hel_proxy/entry.js",
5
+ "module": "hel_proxy_es/entry.js",
6
+ "types": "src/entrance/libTypes.ts",
7
+ "unpkg": "hel_dist/index.html",
8
+ "version": "1.5.0",
9
+ "type": "module",
10
+ "files": [
11
+ "hel_dist",
12
+ "hel_proxy",
13
+ "hel_proxy_es",
14
+ "scripts",
15
+ "README.md",
16
+ "src"
17
+ ],
18
+ "scripts": {
19
+ "dev": "vite --port 7001",
20
+ "start": "vite --port 7001",
21
+ "start:App": "cross-env VITE_COMP=App vite --port 7001",
22
+ "start:Hello": "cross-env VITE_COMP=HelloWorld vite --port 7001",
23
+ "build": "npm run check_name && npm run build_dist && npm run build_meta && npm run build_proxy",
24
+ "build_dist": "vite build",
25
+ "build_dist:local": "cross-env HEL_APP_HOME_PAGE=http://127.0.0.1:7001 vite build",
26
+ "check_name": "node ./scripts/check.cjs",
27
+ "build_proxy": "npm run build_proxy_umd && npm run build_proxy_es && shx cp ./hel_proxy/entry.js ./hel_dist",
28
+ "build_proxy_umd": "rollup -c",
29
+ "build_proxy_es": "cross-env BUILD_ENV=es rollup -c",
30
+ "build_cust": "cross-env HEL_APP_HOME_PAGE=http://127.0.0.1:9001 npm run build && npm run build_meta",
31
+ "build_meta": "node scripts/meta.cjs",
32
+ "preview": "vite preview",
33
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx --fix",
34
+ "prepublishOnly": "node ./scripts/prepublishOnly.cjs"
35
+ },
36
+ "dependencies": {
37
+ "hel-iso": "^4.3.2",
38
+ "hel-lib-proxy": "^4.7.0",
39
+ "tdesign-vue-next": "^1.9.9",
40
+ "vue": "^3.4.21"
41
+ },
42
+ "peerDependencies": {
43
+ "hel-iso": "^4.3.2",
44
+ "hel-lib-proxy": "^4.7.0",
45
+ "vue": "^3.4.21"
46
+ },
47
+ "devDependencies": {
48
+ "@rollup/plugin-terser": "^0.4.4",
49
+ "@rollup/plugin-typescript": "^11.1.6",
50
+ "@vitejs/plugin-vue": "^5.0.4",
51
+ "chalk": "^5.6.2",
52
+ "cross-env": "^7.0.3",
53
+ "dayjs": "^1.11.13",
54
+ "eslint": "^8.57.0",
55
+ "eslint-plugin-vue": "^9.24.0",
56
+ "hel-dev-utils": "^5.4.3",
57
+ "less": "^4.2.0",
58
+ "rollup": "^4.14.1",
59
+ "shx": "^0.3.4",
60
+ "typescript": "^5.4.4",
61
+ "vite": "^5.2.8"
62
+ },
63
+ "browserslist": [
64
+ "> 1%",
65
+ "last 2 versions",
66
+ "not dead"
67
+ ]
68
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 此脚本被蓝盾【JS脚本执行】插件执行,脚本会被放到沙箱中执行,不允许引用非node内置模块,
3
+ * 故在插件里触发安装后,通过 libs.deploySDK 把 @tencent/hel-mono-deploy 包透传进来使用,
4
+ */
5
+ /** @typedef {import('@tencent/helpack-ld-types').IDeployOptions} IDeployOptions */
6
+
7
+ exports.buildCI = async function (/** @type IDeployOptions */options, libs) {
8
+ try {
9
+ await libs.deploySDK.deployLegacyHelMod(options);
10
+ } catch (err) {
11
+ console.error(err);
12
+ process.exit(1);
13
+ }
14
+ };
@@ -0,0 +1,13 @@
1
+ /*
2
+ |--------------------------------------------------------------------------
3
+ |
4
+ | 此脚本在流水线上会被触发,用于校验组名是否和应用里的组名保持一致
5
+ |
6
+ |--------------------------------------------------------------------------
7
+ */
8
+ const path = require('path');
9
+ const helDevUtils = require('hel-dev-utils');
10
+ const pkg = require('../package.json');
11
+
12
+ const fileFullPath = path.join(__dirname, '../src/configs/subApp');
13
+ helDevUtils.check(pkg, { fileFullPath, checkEnv: false });
@@ -0,0 +1,22 @@
1
+ /*
2
+ |--------------------------------------------------------------------------
3
+ |
4
+ | 生成meta
5
+ |
6
+ |--------------------------------------------------------------------------
7
+ */
8
+ const process = require('process');
9
+ const path = require('path');
10
+ const helDevUtils = require('hel-dev-utils');
11
+ const packageJson = require('../package.json');
12
+ const appInfo = require('../appInfo.cjs');
13
+
14
+ helDevUtils.extractHelMetaJson({
15
+ appInfo,
16
+ buildDirFullPath: path.join(__dirname, '../hel_dist'),
17
+ packageJson,
18
+ enableRelativePath: true,
19
+ }).catch(err => {
20
+ console.error(err);
21
+ process.exit(-1);
22
+ });
@@ -0,0 +1,25 @@
1
+ /*
2
+ |--------------------------------------------------------------------------
3
+ | npm publush 前检查根目录下 package.json 的版本号是否和 hel_dist/hel-meta.json 一致
4
+ |--------------------------------------------------------------------------
5
+ */
6
+
7
+ const pkg = require('../package.json');
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const helDistPath = path.resolve(__dirname, '../hel_dist/hel-meta.json');
11
+ const existHelMeata = fs.existsSync(helDistPath);
12
+
13
+ // 检查是否执行npm run build 打包命令
14
+ if (!existHelMeata) {
15
+ console.error("Run the 'npm run build' command first.\n");
16
+ process.exit(1);
17
+ }
18
+ const { app } = JSON.parse(fs.readFileSync(helDistPath, 'utf-8'));
19
+ // 检查根目录下 package.json 的版本号是否和 hel_dist/hel-meta.json 一致
20
+ if (app?.build_version !== pkg.version) {
21
+ console.error(
22
+ 'The package.json version number and the hel_dist/hel-meta.json version number must be the same.\n'
23
+ );
24
+ process.exit(1);
25
+ }
Binary file
@@ -0,0 +1,256 @@
1
+ <template>
2
+ <div id="app">
3
+ <!-- <img alt="Vue logo" src="../assets/logo.png" /> -->
4
+ <!-- <h2>name: {{ name }}</h2> -->
5
+ <!-- <HelloWorld msg="Welcome to view project hel-tpl-remote-vue-comp ( from unpkg deploy )" /> -->
6
+
7
+ <!-- 计算器组件 -->
8
+ <div class="calculator-wrapper">
9
+ <t-card title="计算器" class="calculator-card">
10
+ <!-- 显示屏 -->
11
+ <div class="display">
12
+ <div class="expression">{{ expression || '0' }}</div>
13
+ <div class="result">{{ displayValue }}</div>
14
+ </div>
15
+
16
+ <!-- 按钮区域 -->
17
+ <div class="buttons">
18
+ <t-button
19
+ v-for="btn in buttons"
20
+ :key="btn.value"
21
+ :theme="btn.theme || 'default'"
22
+ :variant="btn.variant || 'outline'"
23
+ class="calc-btn"
24
+ :class="btn.class"
25
+ @click="handleClick(btn.value)"
26
+ >
27
+ {{ btn.label }}
28
+ </t-button>
29
+ </div>
30
+ </t-card>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <script setup>
36
+ import { ref, computed, defineProps } from 'vue';
37
+ import HelloWorld from "./HelloWorld.vue";
38
+
39
+ defineProps({
40
+ name: String,
41
+ });
42
+
43
+ // 当前显示值
44
+ const displayValue = ref('0');
45
+ // 完整表达式
46
+ const expression = ref('');
47
+ // 是否刚计算完结果
48
+ const justCalculated = ref(false);
49
+
50
+ // 计算器按钮配置
51
+ const buttons = [
52
+ { label: 'C', value: 'clear', theme: 'danger', variant: 'base' },
53
+ { label: '±', value: 'negate', theme: 'default', variant: 'outline' },
54
+ { label: '%', value: 'percent', theme: 'default', variant: 'outline' },
55
+ { label: '÷', value: '/', theme: 'warning', variant: 'base', class: 'operator' },
56
+
57
+ { label: '7', value: '7' },
58
+ { label: '8', value: '8' },
59
+ { label: '9', value: '9' },
60
+ { label: '×', value: '*', theme: 'warning', variant: 'base', class: 'operator' },
61
+
62
+ { label: '4', value: '4' },
63
+ { label: '5', value: '5' },
64
+ { label: '6', value: '6' },
65
+ { label: '-', value: '-', theme: 'warning', variant: 'base', class: 'operator' },
66
+
67
+ { label: '1', value: '1' },
68
+ { label: '2', value: '2' },
69
+ { label: '3', value: '3' },
70
+ { label: '+', value: '+', theme: 'warning', variant: 'base', class: 'operator' },
71
+
72
+ { label: '0', value: '0', class: 'zero' },
73
+ { label: '.', value: '.' },
74
+ { label: '=', value: '=', theme: 'primary', variant: 'base', class: 'equals' },
75
+ ];
76
+
77
+ // 处理按钮点击
78
+ const handleClick = (value) => {
79
+ switch (value) {
80
+ case 'clear':
81
+ clear();
82
+ break;
83
+ case 'negate':
84
+ negate();
85
+ break;
86
+ case 'percent':
87
+ percent();
88
+ break;
89
+ case '=':
90
+ calculate();
91
+ break;
92
+ case '+':
93
+ case '-':
94
+ case '*':
95
+ case '/':
96
+ handleOperator(value);
97
+ break;
98
+ case '.':
99
+ handleDecimal();
100
+ break;
101
+ default:
102
+ handleNumber(value);
103
+ }
104
+ };
105
+
106
+ // 清空
107
+ const clear = () => {
108
+ displayValue.value = '0';
109
+ expression.value = '';
110
+ justCalculated.value = false;
111
+ };
112
+
113
+ // 正负号切换
114
+ const negate = () => {
115
+ if (displayValue.value !== '0') {
116
+ if (displayValue.value.startsWith('-')) {
117
+ displayValue.value = displayValue.value.slice(1);
118
+ } else {
119
+ displayValue.value = '-' + displayValue.value;
120
+ }
121
+ }
122
+ };
123
+
124
+ // 百分比
125
+ const percent = () => {
126
+ const num = parseFloat(displayValue.value);
127
+ displayValue.value = String(num / 100);
128
+ };
129
+
130
+ // 处理数字输入
131
+ const handleNumber = (num) => {
132
+ if (justCalculated.value) {
133
+ displayValue.value = num;
134
+ expression.value = num;
135
+ justCalculated.value = false;
136
+ } else if (displayValue.value === '0') {
137
+ displayValue.value = num;
138
+ } else {
139
+ displayValue.value += num;
140
+ }
141
+ };
142
+
143
+ // 处理小数点
144
+ const handleDecimal = () => {
145
+ if (justCalculated.value) {
146
+ displayValue.value = '0.';
147
+ expression.value = '0.';
148
+ justCalculated.value = false;
149
+ } else if (!displayValue.value.includes('.')) {
150
+ displayValue.value += '.';
151
+ }
152
+ };
153
+
154
+ // 处理运算符
155
+ const handleOperator = (op) => {
156
+ justCalculated.value = false;
157
+ const opSymbol = op === '*' ? '×' : op === '/' ? '÷' : op;
158
+ expression.value = displayValue.value + ' ' + opSymbol + ' ';
159
+ displayValue.value = '0';
160
+ };
161
+
162
+ // 计算结果
163
+ const calculate = () => {
164
+ if (!expression.value) return;
165
+
166
+ try {
167
+ // 构建完整表达式
168
+ const fullExpression = expression.value
169
+ .replace(/×/g, '*')
170
+ .replace(/÷/g, '/')
171
+ .replace(/ /g, '') + displayValue.value;
172
+
173
+ // 安全计算
174
+ const result = Function('"use strict"; return (' + fullExpression + ')')();
175
+
176
+ if (isFinite(result)) {
177
+ // 保留合理的小数位数
178
+ displayValue.value = String(Math.round(result * 1000000000) / 1000000000);
179
+ expression.value = fullExpression + ' =';
180
+ } else {
181
+ displayValue.value = 'Error';
182
+ }
183
+ justCalculated.value = true;
184
+ } catch (e) {
185
+ displayValue.value = 'Error';
186
+ justCalculated.value = true;
187
+ }
188
+ };
189
+ </script>
190
+
191
+ <style scoped>
192
+ #app {
193
+ font-family: Avenir, Helvetica, Arial, sans-serif;
194
+ -webkit-font-smoothing: antialiased;
195
+ -moz-osx-font-smoothing: grayscale;
196
+ text-align: center;
197
+ color: #2c3e50;
198
+ margin-top: 60px;
199
+ }
200
+
201
+ .calculator-wrapper {
202
+ display: flex;
203
+ justify-content: center;
204
+ margin-top: 30px;
205
+ }
206
+
207
+ .calculator-card {
208
+ width: 320px;
209
+ border-radius: 16px;
210
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
211
+ }
212
+
213
+ .display {
214
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
215
+ border-radius: 12px;
216
+ padding: 20px;
217
+ margin-bottom: 20px;
218
+ text-align: right;
219
+ min-height: 80px;
220
+ }
221
+
222
+ .expression {
223
+ color: rgba(255, 255, 255, 0.7);
224
+ font-size: 14px;
225
+ min-height: 20px;
226
+ word-break: break-all;
227
+ }
228
+
229
+ .result {
230
+ color: #fff;
231
+ font-size: 36px;
232
+ font-weight: 600;
233
+ word-break: break-all;
234
+ }
235
+
236
+ .buttons {
237
+ display: grid;
238
+ grid-template-columns: repeat(4, 1fr);
239
+ gap: 10px;
240
+ }
241
+
242
+ .calc-btn {
243
+ height: 56px;
244
+ font-size: 18px;
245
+ font-weight: 500;
246
+ border-radius: 12px;
247
+ }
248
+
249
+ .calc-btn.zero {
250
+ grid-column: span 2;
251
+ }
252
+
253
+ .calc-btn.operator {
254
+ font-size: 22px;
255
+ }
256
+ </style>
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <div class="hello">
3
+ <hr />
4
+ <h1>{{ msg }}</h1>
5
+ <h2>I am a remote vue component (Vue3)</h2>
6
+ </div>
7
+ </template>
8
+
9
+ <script setup>
10
+ defineProps({
11
+ msg: String,
12
+ });
13
+ </script>
14
+
15
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
16
+ <style scoped>
17
+ h3 {
18
+ margin: 40px 0 0;
19
+ }
20
+ ul {
21
+ list-style-type: none;
22
+ padding: 0;
23
+ }
24
+ li {
25
+ display: inline-block;
26
+ margin: 0 10px;
27
+ }
28
+ a {
29
+ color: #42b983;
30
+ }
31
+ </style>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div id="app">
3
+ <div :class="btnType">{{ btnType }} 按钮</div>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ defineProps({
9
+ btnType: {
10
+ default: 'primary',
11
+ type: String,
12
+ }
13
+ });
14
+ </script>
15
+
16
+ <style scoped>
17
+ .primary {
18
+ margin-left: 10px;
19
+ color: #fff;
20
+ background-color: #409eff;
21
+ border-color: #409eff;
22
+ padding: 12px 20px;
23
+ font-size: 14px;
24
+ border-radius: 4px;
25
+ outline: none;
26
+ border: 1px solid #dcdfe6;
27
+ cursor: pointer;
28
+ }
29
+ .warning {
30
+ margin-left: 10px;
31
+ color: #fff;
32
+ background-color: #e6a23c;
33
+ border-color: #e6a23c;
34
+ padding: 12px 20px;
35
+ font-size: 14px;
36
+ border-radius: 4px;
37
+ outline: none;
38
+ border: 1px solid #dcdfe6;
39
+ cursor: pointer;
40
+ }
41
+ </style>