Preface
一个vue的demo
Source code description
Project directory description
. |-- config // 项目开发环境配置| |-- index.js // 项目打包部署配置|-- src // 源码目录| |-- components // 公共组件| |-- header.vue // 页面头部公共组件| |-- footer.vue // 页尾头部公共组件| |-- index.js // 加载各种公共组件| |-- config // 路由配置和程序的基本信息配置| |-- routes.js // 配置页面路由| |-- css // 各种css文件| |-- common.css // 全局通用css文件| |-- iconfont // 各种字体图标| |-- images // 公共图片| |-- less // 各种less文件| |-- common.less // 全局通用less文件| |-- pages // 页面组件| |-- home // 个人中心| |-- index // 网站首页| |-- login // 登录| |-- signout // 退出| |-- store // vuex的状态管理| |-- index.js // 加载各种store模块| |-- user.js // 用户store| |-- template // 各种html文件| |-- index.html // 程序入口html文件| |-- util // 公共的js方法,vue的mixin混合| |-- app.vue // 页面入口文件| |-- main.js // 程序入口文件,加载各种公共组件|-- .babelrc // ES6语法编译配置|-- gulpfile.js // 启动,打包,部署,自动化构建|-- webpack.config.js // 程序打包配置|-- server.js // 代理服务器配置|-- README.md // 项目说明|-- package.json // 配置项目相关信息,通过执行 npm init 命令创建.
Development environment dependency module description
webpack related modules
webpack // 用来构建打包程序webpack-dev-server // 开发环境下,设置代理服务器html-webpack-plugin // html 文件编译url-loader // 图片 转化成base64格式file-loader // 字体 将字体文件打包css-loader // css 生成less // css 预处理器lessless-loader // css 预处理器less的webpack插件style-loader // css 插入到style标签autoprefixer-loader // css 浏览器兼容性问题处理babel-core // ES6 代码转换器babel-loader // ES6 代码转换器,webpack插件babel-plugin-transform-object-assign // ES6 Object.assign方法做兼容处理babel-preset-es2015 // ES6 代码编译成现在浏览器支持的ES5babel-preset-stage-0 // ES6 ES7要使用的语法阶段vue-loader // vue 组件编译babel-helper-vue-jsx-merge-props // vue jsx语法编译babel-plugin-syntax-jsx // vue jsx语法编译babel-plugin-transform-vue-jsx // vue jsx语法编译
gulp related modules
gulp // 用来构建自动化工作流gulp-sftp // 将代码自动部署到服务器上del // 代码部署成功后,删除本地编译的代码
Others Module
cross-env // 解决跨平台设置NODE_ENV的问题
Production module dependency description
vue family bucket
vue // 构建用户界面的vue-router // 路由vuex // 组件状态管理
Page description
/login // 登录,不需要登录可以访问/signout // 退出登录,需要登录后才可以访问/home // 个人中心,需要登录后才可以访问/ // 首页,不需要登录可以访问* // 强制跳转到登录页面
Run the program
npm installnpm run dev localhost:3000/app/
The above is the detailed content of Detailed explanation of examples of developing apps with vue. For more information, please follow other related articles on the PHP Chinese website!

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
