GithubHelp home page GithubHelp logo

hhy5277 / iview-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhaotoday/element-plus

0.0 1.0 0.0 634 KB

admin template based on Vue CLI 3 & iView. 基于 Vue CLI 3 + iView 的 Vue.js 后台管理系统。

JavaScript 28.54% HTML 0.33% Vue 64.31% CSS 6.81%

iview-1's Introduction

关于

介绍

基于 Vue CLI 3 + iView 的后台管理系统,支持:开发调试、构建、代码规范校验等。

技术栈

Vue、Webpack、ES6、Vue Router、Vuex、Sass、PostCSS 等。

例子

线上的例子

https://admin.cmsx.cn/

用户:admin
密码:123456

服务端框架

https://github.com/zhaotoday/less.js

命令

# 下载代码
$ git clone https://github.com/zhaotoday/iview.git

# 安装依赖
$ npm install

# 开发调试
$ npm run serve

# 代码校验
$ npm run lint

# 构建
$ npm run build

规范

项目结构

|-- public                           // 网站公共目录
|   |-- favicon.ico                  // 网站图标
|   |-- index.html                   // 模板文件
|-- src                              // 源码目录
|   |-- components                   // 公共组件
|   |-- mixins                       // 混入
|   |-- models                       // 数据模型
|   |-- plugins                      // 插件
|   |-- router                       // 路由配置
|       |-- routes                   // 各个视图的路由配置
|   |-- store                        // 状态管理
|       |-- actions.js               // 根级别的 actions
|       |-- getters.js               // 根级别的 getters
|       |-- mutations.js             // 根级别的 mutations
|       |-- types.js                 // 根级别的 mutation types
|       |-- modules                  // 各业务模块的局部状态管理
|           |-- articles             // 文章业务模块状态管理
|   |-- styles                       // 样式
|       |-- global                   // 全局样式
|       |-- utils                    // Sass 工具
|       |-- iview                    // 第三方 UI 库的样式(如:iView 等)
|   |-- utils                        // JS 工具
|   |-- views                        // 视图
|       |-- articles                 // 文章页
|       |-- home                     // 首页
|       |-- root                     // 根页面
|   |-- app.vue                      // 页面入口
|   |-- main.js                      // 程序入口

公共组件规范

公共组件放在 /src/components 下。

|-- my-component              // my component 组件
|   |-- index.vue             // my component 的入口
|   |-- styles                // my component 的样式
|       |-- index.scss        // my component 的样式入口
|       |-- images            // my component 的图片
|   |-- utils                 // my component 的 JS 工具
|   |-- components            // my component 的子组件
|       |-- child-component   // my component 的子组件 child component

视图规范

视图放在 /src/views 下,也就是一个页面,对应一个路由。规范和公共组件一致。

加入 iView 组件库

提供 less 支持

# 安装 less-loader、less
$ npm install --save-dev less-loader less

自定义 iView 的主题

/src/styles/iview/index.less:

@import '~iview/src/styles/index.less';

/* 接下来开始覆盖 less 变量 */

链接

引入 iView

/src/main.js:

import iView from 'iview'

Vue.use(iView)

引入 iView Loader

[官网原话]统一 iView 标签书写规范,所有标签都可以使用首字母大写的形式,包括 Vue 限制的两个标签 Switch 和 Circle。

$ npm install --save-dev iview-loader
module: {
  rules: [
    {
      test: /\.vue$/,
      use: [
        {
          loader: 'vue-loader',
          options: {}
        },
        {
          loader: 'iview-loader',
          options: {
            prefix: false
          }
        }
      ]
    }
  ]
}

参考

网址

相关链接

iview-1's People

Contributors

zhaotoday 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.