Table of Contents
github link
Wuji front-end construction process
Local environment preparation
Dependency package installation
Build
About source Mapping (only supports chrome browser)
hot reload (supports real-time refresh of the build)
Custom theme
autoprefixer (style prefix compatibility processing), configure in vue-loader option
Static resource gulp processing (/public)
front-end page
Home Web Front-end JS Tutorial Vue2.0 web application developed by FamilyBucket (refer to Wuji APP)

Vue2.0 web application developed by FamilyBucket (refer to Wuji APP)

Jun 26, 2017 pm 03:13 PM
application develop Web page

Learn from Wuji APP, use vue2.0+vue-router+vuex as the main technology stack, elementui as the UI framework, and multi-module spa mode , webpack2.0 is responsible for module packaging, and gulp is responsible for handling static resource packaging and compression. Welcome to reward stars! ! !

Wuji front-end construction process

Local environment preparation

  • Install node: * ("node": ">=6.0", corresponding to needs Upgrade node-sass, otherwise you can’t use it! )

  • Configure webpack: npm install -g webpack (sudo permission)

  • windows configuration cnpm:

npm install -g cnpm --registry=https:
Copy after login

Dependency package installation

  • Enter the wuji directory

  • Execute cnpm install

Build

  • Development environment: execute node server.js (or npm run serve)

  • Hot reload node server.js hot-reload (or npm run hot)

  • mock data npm run mock

  • Production environment: Execute npm run build

About source Mapping (only supports chrome browser)

  • source Mapping is a code mapping tracking, which is convenient for local development debug compressed file

  • Make sure chrome has source Mapping turned on (the default is turned on)

  • Open Develop Tools -》Sources to see the source File

hot reload (supports real-time refresh of the build)

  • Environment preparation:

  • cnpm install express webpack-dev-middleware webpack-hot-middleware

  • Execute node server.js hot-reload (or npm run hot)

  • Static resource access eg: http://localhost:8088/Static/...

Custom theme

  • Enter wuji directory

  • cnpm install element-theme element-theme-default --save-dev (the dependency package has been installed during installation)

  • Execute node_modules/.bin /et -i

  • Generate element-variables.css

  • Execute node_modules/.bin/et

  • will create ./theme

  • When changing the theme, the corresponding modifications to .babelrc will be as follows:

    {      "plugins": [["component", [
        {          "libraryName": "element-ui",          "styleLibraryName": "~theme"}
      ]]]
    }
Copy after login

autoprefixer (style prefix compatibility processing), configure in vue-loader option

  • Generation rules:

  • Automatically add browser Style prefix, compatible with all browsers (for shares greater than 1% of global statistics, firefox 15)

Static resource gulp processing (/public)

var gulp = require('gulp'),
    uglify = require('gulp-uglify'), //压缩jsrename = require("gulp-rename"), //文件重命名changed = require('gulp-changed'), //监听文件是否修改imagemin = require('gulp-imagemin'), // 图片压缩pngquant = require('imagemin-pngquant'), // 深度压缩runSequence = require('run-sequence'),     // 同步运行任务插件del = require('del'), //删除文件spritesmith = require('gulp.spritesmith'), //合成雪碧图find = require("gulp-find-glob"); //得到glob对象
Copy after login
  • Enter the wuji/assets/public directory

  • cnpm install

  • Execute gulp (compressed js, pictures)

  • Execute gulp sprite (generate sprite image) [Put the image that needs to be synthesized into sprite into a new folder in images/sprite/, and run, You can see the corresponding sprite.png, sprite.scss]

front-end page

index.html => My diary List
passing.html => Passing list
account.html => Login registration page

WeChat mini program actual github:

The above is the detailed content of Vue2.0 web application developed by FamilyBucket (refer to Wuji APP). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The role and practical application of arrow symbols in PHP The role and practical application of arrow symbols in PHP Mar 22, 2024 am 11:30 AM

The role and practical application of arrow symbols in PHP

Four recommended AI-assisted programming tools Four recommended AI-assisted programming tools Apr 22, 2024 pm 05:34 PM

Four recommended AI-assisted programming tools

How to Undo Delete from Home Screen in iPhone How to Undo Delete from Home Screen in iPhone Apr 17, 2024 pm 07:37 PM

How to Undo Delete from Home Screen in iPhone

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Apr 07, 2024 am 09:10 AM

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent

Learn how to develop mobile applications using Go language Learn how to develop mobile applications using Go language Mar 28, 2024 pm 10:00 PM

Learn how to develop mobile applications using Go language

How to open php on the web page How to open php on the web page Mar 22, 2024 pm 03:20 PM

How to open php on the web page

From beginner to proficient: Explore various application scenarios of Linux tee command From beginner to proficient: Explore various application scenarios of Linux tee command Mar 20, 2024 am 10:00 AM

From beginner to proficient: Explore various application scenarios of Linux tee command

Understanding VSCode: What is this tool used for? Understanding VSCode: What is this tool used for? Mar 25, 2024 pm 03:06 PM

Understanding VSCode: What is this tool used for?

See all articles