Giter VIP home page Giter VIP logo

dmcdoudou / vue-h5-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ewall1106/vue-h5-template

0.0 1.0 0.0 845 KB

使用Vue3.0+Typescript+Vant搭建移动端H5页面开发所需的基础模板,并提供一些通用型的解决方案及扩展功能。

Home Page: https://docs.xwhx.top/vue-h5-template/

License: MIT License

JavaScript 2.63% HTML 0.75% Vue 11.18% SCSS 1.55% TypeScript 83.88%

vue-h5-template's Introduction

VUE-H5-TEMPLATE

vue vant license

Vue-H5-Template 项目以小商城作为基本的内容演示,使用 Vue3.0+Typescript+Vant 搭建 移动端h5页面 开发所需的基础模板,并提供一些通用型的解决方案及扩展功能。

基本说明

部分页面预览:

首页 商详 扩展

手机扫码预览:

安装使用

# 项目下载
# 克隆项目很慢?将地址中的 `github.com` 替换为 `github.com.cnpmjs.org` 试试
$ git clone [email protected]:Ewall1106/vue-h5-template.git

# 安装运行
$ yarn & yarn dev

功能特性

🔨 开发规范

  • Eslint 校检及错误提示
  • Prettier 统一代码风格
  • StyleLint 样式风格
  • Typescript 语法支持

🔨 初始化配置

  • vw 移动端适配
  • css 预处理器
  • 浏览器默认样式处理
  • promise 降级
  • fast-click 处理

🔨 基础功能

  • vuex4.0 封装及使用
  • vue-router4.x 路由配置及权限控制
  • axios+typescript 封装及请求
  • composition-api 及自定义 hooks 封装

🔨 组件相关

  • vant 组件的安装及使用
  • scroll 横向滚动组件封装
  • svg-icon 图标组件

🔨 其它方面

  • vscode 调试
  • ....

目录结构

|-- public                // public
|-- config                // config配置文件
|-- src
|   |-- api               // 接口列表
|   |-- assets            // 图片资源
|   |-- components        // 公共组件
|   |-- hooks             // 全局hooks
|   |-- icons             // svg图标
|   |-- router            // 路由
|   |-- store             // vuex
|   |-- styles            // 公共样式
|   |-- types             // 文件声明
|   |-- utils             // 工具函数
|   |-- views             // 各级页面
|   |   |-- home          // 首页
|   |   |   |-- components   // 局部组件
|   |   |   |-- hooks        // 局部hooks
|   |   |   |-- index.vue    // 页面
|   |   |-- user          // 用户
|   |   |-- ....          // ...
|   |-- App.vue           // 主页面
|   |-- main.js           // 入口文件
|-- .eslintrc.js          // eslint配置
|-- .prettierrc           // .prettier配置
|-- babel.config.js       // babel配置文件
|-- changelog.md          // 更新日志
|-- package.json          // 客户端依赖
|-- postcss.config.js     // postcss配置文件
|-- vue.config.js         // vue相关配置文件
|-- ...

🔖 目录说明:

  • 目录 components 下的所有公共组件使用 tsx 进行开发。
  • 目录 views 下的业务组件使用 sfc 的形式进行开发。
  • 为什么这样划分?对于公共组件来说,使用 tsx 开发更加灵活、渲染性能更好且更方便测试。对于业务组件,使用 sfc 的方式可以更好的发挥出 vue 的优势,简洁明了。

协议

  • MIT

  • Copyright (c) 2021-present Ewall&熊猫

vue-h5-template's People

Contributors

ewall1106 avatar

Watchers

 avatar

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.