mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2026-12-02 13:53:47 +08:00
1.1 KiB
1.1 KiB
UI and Mobile Adaptation
UI Libraries
The template integrates Vant, NutUI, and Varlet through unplugin-vue-components and unplugin-auto-import. The demo compares all three; production applications should not treat long-term mixing as the default.
For a product project:
- Select one primary UI library.
- Remove unused UI packages and resolvers from
package.json. - Clean up
component.ts,autoImport.ts, and related imports insrc/main.ts. - Remove unused demo sections and run
pnpm check.
Viewport Conversion
postcss.config.mjs uses cnjm-postcss-px-to-viewport:
- Application styles use a 750px design width.
- Vant, NutUI, and Varlet dependency styles use a 375px design width.
- Values at or below 1px are preserved for thin borders.
- Default targets are Android 8+, iOS 15+, and Chrome 80+.
Safe Areas and Scrolling
- The layout uses
100dvh, an independent vertical scroller, andoverscroll-behavior. - The tabbar enables bottom safe-area handling.
- The fixed purchase bar reserves
env(safe-area-inset-bottom).
Any new fixed bottom action must reserve matching content padding so it does not cover page content.