diff --git a/apps/taro/test/browser/preview.spec.ts b/apps/taro/test/browser/preview.spec.ts index 91d2154..3044a88 100644 --- a/apps/taro/test/browser/preview.spec.ts +++ b/apps/taro/test/browser/preview.spec.ts @@ -4,6 +4,11 @@ test("真实 API 驱动首页、出摊和主理人视觉槽位", async ({ page } page.on("pageerror", (error) => errors.push(error.message)); await page.goto("/"); await expect(page.locator(".food-home .name")).toContainText("阿成"); + const actionBounds = await page.locator(".food-home .actions button").evaluateAll((buttons) => { + const parent = buttons[0].parentElement!.getBoundingClientRect(); + return buttons.map((button) => button.getBoundingClientRect().right - parent.right); + }); + expect(Math.max(...actionBounds)).toBeLessThanOrEqual(1); const widths = await page.locator(".scene").evaluate((element) => ({ image: element.getBoundingClientRect().width, parent: element.parentElement!.getBoundingClientRect().width, diff --git a/packages/template-acheng-campus-food/taro/style.css b/packages/template-acheng-campus-food/taro/style.css index 7efc8c7..629c6d7 100644 --- a/packages/template-acheng-campus-food/taro/style.css +++ b/packages/template-acheng-campus-food/taro/style.css @@ -128,7 +128,13 @@ margin-top: 20px; } .food-home .actions button { - flex: 1; + flex: 1 1 0; + width: 0; + min-width: 0; + margin: 0; + padding: 0 8px; + overflow: hidden; + white-space: nowrap; height: 76px; border-radius: 20px; background: #e87532;