Skip to content

Commit

Permalink
release V1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lkd committed Feb 21, 2019
1 parent b48e041 commit 668bb2a
Show file tree
Hide file tree
Showing 18 changed files with 11,804 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# responsive-element
开箱即用的`element-ui`响应式模板,基于`vue-cli 3`搭建,使用`webpack 4`,更多配置见[配置参考](https://cli.vuejs.org/zh/config/)

### 响应式思路
通过`pxtorem``element-ui`中的单位转为`rem`以配合响应式。

### 项目配置
- 安装依赖
```
npm install
```

#### 配置响应式
- 文件目录 `public/index.html`

```
const designWidth = 1920 // 设计稿宽度 1920px
const rem2px = 100 // rem基数 1rem = 100px 基数请与wepack中pxtorem的rootValue保持一致
```

#### 配置`pxtorem`
- 文件目录: `./vue.config.js`

```
// 将element px转换为rem
css: {
loaderOptions: {
postcss: {
plugins: [
autoprefixer(),
pxtorem({
rootValue: 100, // 基数请与 public/index.html 中的rem2px保持一致
propList: ['*']
})
]
}
}
},
```

### :rocket:启动项目(开发环境)
```
npm run dev
```

### 编译项目(生成环境)
```
npm run build
```
14 changes: 14 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/app'
],
plugins: [
[
"component",
{
"libraryName": "element-ui", // 按需引入element-ui组件
"styleLibraryName": "theme-chalk" // 默认主题
}
]
]
}
Loading

0 comments on commit 668bb2a

Please sign in to comment.