Giter Club home page Giter Club logo

charleewa / vue3-vant-mobile Goto Github PK

View Code? Open in Web Editor NEW
740.0 13.0 151.0 1.11 MB

An mobile web apps template based on the Vue 3 ecosystem。 一个基于 Vue 3 生态系统的移动 web 应用模板,帮助你快速完成业务开发。

Home Page: https://vue3-vant-mobile.netlify.app

License: MIT License

HTML 2.72% Vue 31.96% TypeScript 61.57% JavaScript 1.48% Less 2.26%
mobile typescript vuejs h5 vue3-template setup unocss wechat-h5 starter vite-starter vite-template

vue3-vant-mobile's Introduction

vue3-vant-mobile

Live Demo

An mobile web apps template based on the Vue 3 ecosystem

license version repo-size languages issues


English / 简体中文


Features


Pre-packed

UI Frameworks

Plugins

Coding Style

Dev tools

Try it now

vue3-vant-mobile requires Node 18+

GitHub Template

Create a repo from this template on GitHub

Clone to local

If you prefer to do it manually with the cleaner git history

npx degit easy-temps/vue3-vant-mobile my-mobile-app
cd my-mobile-app
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm

Checklist

When you use this template, try follow the checklist to update your info properly

  • Change the author name in LICENSE
  • Change the title in index.html
  • Change the hostname in vite.config.ts
  • Change the favicon in public
  • Clean up the READMEs and remove routes

And, enjoy :)

Usage

Development

Just run and visit http://localhost:3000

pnpm dev

Build

To build the App, run

pnpm build

And you will see the generated file in dist that ready to be served.

Deploy on Netlify

Go to Netlify and select your clone, OK along the way, and your App will be live in a minute.

Contributors

CharleeWa
Charlie Wang
weiq
魏小雨
AlphaYoung
AlphaYoung
Leezon
Leezon
liuNing
liuNing
wswmsword
wswmsword
Kysen
Kysen
smartsf
阿峰
ReginYuan
ReginYuan
Abraham K.
Abraham K.
Mia Campbell
Mia Campbell
ljt990218
ljt990218
sven
sven
ChunyuPCY
ChunyuPCY

Star History

Star History Chart

vue3-vant-mobile's People

Contributors

alphayoung111 avatar charleewa avatar chunyupcy avatar inshomepgup avatar kysen777 avatar leo4developer avatar ljt990218 avatar reginyuan avatar smartsf avatar sublimect avatar weiq avatar wowping avatar wswmsword avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue3-vant-mobile's Issues

Rewrite Dark Mode

更好的实现方式,也是为了解决 unocss 抒写 dark mode 下的 css 的问题

相关议题:#6

疑问

可以结合uniapp吗?否则app怎么打包啊

Dark Mode - 自动读取用户的系统首选项的显示问题

我们知道 Vant 组件支持深色模式,通过 VanConfigProvider 组件控制,但是值得注意的是,开启 Vant 的深色模式只会影响 Vant 组件的 UI,并不会影响全局的文字颜色或背景颜色。所以需要开发人员自己实现,vue3-vant-mobile 项目采用 vueuse 的 useDark 可组合函数实现深色模式。

在具体实现当中,用户系统终端的缓存当中就有两个属性来记录当前用户的选择,分别是 vueuse-color-scheme 控制着全局文字颜色或者背景颜色,以及 app 控制着 Vant UI 组件的颜色。

不过在实际生产当中发现一些问题。当用户第一次进入应用后,应用会自动读取用户的系统首选项,比如用户的终端浏览器的外观设置是系统默认,如果当前是白天,应用字体或者背景色就变成浅色模式下的显示;如果是晚上,应用字体或者背景色就变成了深色模式下的显示。目前没有任何问题,不过如果用户手动改变了终端默认选择以后,比如从浅色换到了深色模式, 虽然 vueuse-color-scheme 的显示会立即作出响应,但是 Vant 的 UI 组件却还是之前的模式。

虽然可以通过刷新后重新执行脚本解决,不过还有其它问题。这个讲起来就比较复杂,简单讲就是应用不止一次打开过,而之前缓存了用户的选择。而这次打开造成了背景色 和 Vant 组件颜色不一致问题。打开控制面板看到vueuse-color-scheme 的值是 auto,而 app的值是深色模式,如果当前是白天,那是什么效果呢? 背景是 浅灰色的一个色系,而 vant 组件是黑色的,非常难看。

问题定义清楚以后,解决思路也很简单,我们需要一种手段监听这个变化,然后改变 vant 主题,达成 vueuse-color-schemeapp 一致的效果。

如何关闭eslint

您好,本项目中如何关闭eslint的git监测呀,谢谢答复!

showConfirmDialog 导入报错

导入方式
import { showConfirmDialog } from 'vant'

导入报错
The requested module '/node_modules/.vite/deps/vant.js?v=c4b8af7e' does not provide an export named 'showConfirmDialog'

在电脑端Chrome下预览问题

如下图,如果不切换到移动端预览,下面的tabbar就会超出maxwidth,这个问题怎么解决?

有的时候一个chrome需要同事调试pc版的后台和手机版,所以想直接利用maxwidth预览,而非切换到移动端模式,不然后台那边也要来回切换?

CleanShot 2024-02-20 at 20 46 10@2x

自动导入

建议增加unplugin-auto-import/vite 自动导入功能

格式化问题

如何修改配置,使得 html 代码块放在最上面,现在格式化后,ts代码块自动到了最上面

pnpm build:dev 本地打包测试,dist下的index.html打开空白

pnpm build:dev 本地打包测试,dist下的index.html打开空白,
控制台报错:

Access to script at 'file:///D:/assets/index-4a56b301.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.

image

格式化问题

遇到个奇怪的问题,为什么我新建了vue页面后,按CTRL+S保存后,会把页面格式化为另一种格式,不知如何修改。
保存(格式化)前:
image
保存(格式化)后:
image

Better readme.md

Antfu's Vitesse is a great project that can be used as a starting template for developing vue3 and vite apps, and his readme.md is so well written that I think this is what a template project should look like.

chrome51不支持/颜色异常

README中有写支持chrome51。

不修改直接build,页面上无内容。
修改legacy targets后build:

# vite.config.ts
       legacy({
-        targets: ['defaults', 'not IE 11'],
+        targets: ['chrome >= 51'],
       }),

页面有内容。点击暗黑模式,颜色异常:
2023-01-13_21-19

版本号:
2023-01-13_21-18

关于mock请求规则的疑惑

作者您好,这里关于mock的配置方式,我有一些不明白和不理解的地方还想学习一下,请问这里的mock/modules/prose.js中的这种导出方式,是基于什么规则实现的mock请求拦截呀,我不是很清楚其中的运行机制,此前我也去查看了下mockjs的官方文档,没有头绪,希望学习一下作者对于此中的封装**是如何的?希望能够得到恢复,谢谢!!
mock/modules/prose.js:
image
image
mock/index.js:
image
api中对于配置好的mock的请求:
image

mock页面无法滚动

因为长度不够
image
移除高度限制即可正常
image
在高度小的手机上会导致页面显示不全

vue3-vant-mobile (技术交流群 )

Discussions

请扫码关注公号,点击“联系作者”,扫码加作者为好友(备注“vue3-vant-mobile”),通过后邀请入群

Subscriptions / 公众号

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.