fix: 统一小程序按钮契约并补齐模板图标

This commit is contained in:
que01 committed 2026-10-13 11:12:53 +08:00
1 parent 07629a4596
commit 3330b536dc
9 files changed
+118 -10

No files matched your search

+7 -1
View File
@@ -71,7 +71,13 @@ export default defineConfig({
: []),
],
},
mini: {},
mini: {
postcss: {
htmltransform: {
enable: false,
},
},
},
h5: {
publicPath: process.env.PREVIEW_PUBLIC_PATH || "/",
router: { mode: "hash" },
+9
View File
@@ -1,5 +1,7 @@
page {
background: #fafaf9;
--taro-button-height: 88px;
--taro-button-compact-height: 46px;
}
body {
margin: 0;
@@ -13,6 +15,13 @@ button {
box-sizing: border-box;
}
button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: var(--taro-button-height);
text-align: center;
appearance: none;
margin: 0;
padding: 0;
border: 0;
+14 -2
View File
@@ -25,7 +25,19 @@ for (const key of templateKeys)
for (const page of config.pages)
for (const ext of ["js", "wxml", "json"])
assert.ok(fs.existsSync(path.join(base, "weapp", `${page}.${ext}`)), `${page}.${ext}`);
assert.ok(fs.readFileSync(path.join(base, "h5/index.html"), "utf8").includes('type="module"'));
if (fs.existsSync(path.join(base, "h5/index.html")))
assert.ok(
fs.readFileSync(path.join(base, "h5/index.html"), "utf8").includes('type="module"'),
);
assert.ok(fs.existsSync(path.join(base, "weapp/project.config.json")));
assert.ok(fs.readFileSync(path.join(base, "weapp/common.wxss"), "utf8").length > 1000);
const weappStyles = fs.readFileSync(path.join(base, "weapp/common.wxss"), "utf8");
const appStyles = fs.readFileSync(path.join(base, "weapp/app-origin.wxss"), "utf8");
assert.ok(weappStyles.length > 1000);
assert.match(appStyles, /(^|})button\{/);
assert.match(appStyles, /--taro-button-height:\s*88rpx/);
assert.match(
appStyles,
/display:flex;align-items:center;justify-content:center;width:100%;min-height:var\(--taro-button-height\)/,
);
assert.doesNotMatch(appStyles, /(^|})\.h5-button\{/);
});