Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Franslee committed Mar 18, 2019
2 parents c2cacf5 + a67cf4b commit 805414b
Show file tree
Hide file tree
Showing 26 changed files with 409 additions and 203 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
## 2.0.5

`2019-3-18`

* :sparkles: `Dialog`组件新增支持标签形式用法
* :bug: 修复`DatePicker`组件按需加载scss文件样式丢失的问题
* :zap: 官网布局优化
* :zap: 文档内容完善

## 2.0.4

`2019-3-12`

* :sparkles: 新增构建CommonJS包
* :sparkles: 新增倒计时`CountDown`组件
* :bug: 修复`Rate`组件样式兼容问题
* :bug: 修复`ShortPassword`组件小屏设备样式兼容问题
* :bug: 修复两个组件测试用例问题
* :zap: 优化`Swiper`组件
* :zap: 文档增加目录功能
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ English | [简体中文](./README-zh_CN.md)
## Examples

![NutUI Demo](https://img14.360buyimg.com/uba/jfs/t1/32118/11/559/2782/5c3d81ecEbda0c0f1/5f2b637d11817204.png)
![NutUI Demo](https://img14.360buyimg.com/uba/s260x260_jfs/t1/32118/11/559/2782/5c3d81ecEbda0c0f1/5f2b637d11817204.png)

## Installation

Expand Down
8 changes: 4 additions & 4 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ NutUI是一套京东风格的移动端Vue组件库,开发和服务于移动Web

## 构建版本

* UMD版 nutui.js
* UMD压缩版 nutui.min.js
* CommonJS版 nutui.common.js
* UMD版 **nutui.js**
* UMD压缩版 **nutui.min.js**
* CommonJS版 **nutui.common.js**

> AMD 环境、Webpack 等构建工具环境建议使用 UMD 版,非模块化环境(通过 `<script>` 标签直接引用)建议使用 UMD 压缩版,服务端渲染请使用 CommonJS 版本。
> AMD 环境、Webpack 等构建工具环境建议使用 UMD 版,非模块化环境(如通过 `<script>` 标签直接引用)建议使用 UMD 压缩版,服务端渲染请使用 CommonJS 版本。
最新稳定版:![npm](https://img.shields.io/npm/v/@nutui/nutui.svg)

Expand Down
10 changes: 10 additions & 0 deletions docs/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ import { Dialog,Picker } from '@nutui/nutui';
Dialog.install(Vue);
Picker.install(Vue);
```
如果需要按需加载 scss 文件(如需要自定义主题)时,除了需要把 style 选项值设为为 **scss** 外,还需要修改 webpack 配置文件的 sass-loader 配置,如下所示:

```
{
loader: 'sass-loader',
options: {
data: `@import "@nutui/nutui/dist/styles/index.scss"; `
}
}
```

### 2. 手动引入

Expand Down
2 changes: 1 addition & 1 deletion docs/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $dark-color: #DADADA;
{
loader: 'sass-loader',
options: {
data: `@import "./asset/css/custom.scss"; @import "@nutui/nutui/styles/variable.scss"; `,
data: `@import "./asset/css/custom.scss"; @import "@nutui/nutui/dist/styles/index.scss"; `,
}
}
]
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui",
"version": "2.0.4",
"version": "2.0.5",
"description": "一套轻量级移动端Vue组件库",
"typings": "dist/types/index.d.ts",
"main": "dist/nutui.js",
Expand All @@ -15,6 +15,7 @@
"dev:demo": "cross-env NODE_ENV=development webpack-dev-server -d --open --progress --config build/webpack.demo.dev.conf.js",
"build:demo": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.demo.build.conf.js",
"dev:doc": "cross-env NODE_ENV=development webpack-dev-server -d --open -w --progress --config build/webpack.doc.dev.conf.js",
"doc:clear": "node scripts/clearcache.js",
"dev": "npm run dev:demo",
"dev:carefree": "cross-env NODE_ENV=carefree carefree_env=dev webpack -w --colors --progress --config build/webpack.demo.dev.conf.js",
"build:doc": "cross-env NODE_ENV=production webpack --hide-modules --progress --config build/webpack.doc.build.conf.js",
Expand Down Expand Up @@ -103,6 +104,7 @@
"mocha": "5.2.0",
"mocha-webpack": "2.0.0-beta.0",
"moment": "2.22.2",
"node-filelist": "^1.0.0",
"node-notifier": "5.2.1",
"node-sass": "4.9.3",
"nyc": "10.0.0",
Expand Down
5 changes: 5 additions & 0 deletions scripts/clearcache.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fs = require('fs');
const path = require('path');
fs.writeFileSync(path.join(__dirname,'./localdocs.cache'),"",'utf-8');
fs.writeFileSync(path.join(__dirname,'./localsrc.cache'),"",'utf-8');
console.log("缓存清除成功")
54 changes: 11 additions & 43 deletions scripts/mdToVue.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let marked = require('marked');
if (!marked) {
console.log('you need npm i marked -D!');
}
var nodeFilelist = require('node-filelist');
//文件监听
let Chokidar = require('chokidar');
// 基本配置文件信息
Expand Down Expand Up @@ -261,8 +262,7 @@ function comparehash(path,callback){
.catch(error => {
return console.error('hashing failed:', error);
});
})

})
}
//文件监听
function filelisten(param){
Expand Down Expand Up @@ -290,21 +290,18 @@ function filelisten(param){
*/
function fileDisplay(param) {
//检查文件是否第一次初始化并获取hash
comparehash(param.entry,(hashMsgObj)=>{

// 获取目录下所有文件
readDirRecur(param.entry, function(filePath) {
//文件列表
fileList.map(item=>{
ismd(item,hashMsgObj,res=>{
comparehash(param.entry,(hashMsgObj)=>{
nodeFilelist.read([param.entry],{"ext":"md"},res=>{
let reslength = res.length;
let routers = [];
res.map((item,index)=>{ //数组化文件
ismd(item.path,hashMsgObj,res=>{
//res md文件处理结果
createdFile(param.output + res.mdName + '.vue', res.html, param)
})
})
});
});


})
})
});
}

/**
Expand All @@ -326,35 +323,6 @@ function ishasOutFile(outPath,callback){
}
})
}
// function checkLoacl(){
// var selfFile = './scripts/mdToVue.js';
// //获取文件内容

// checkIsexists(selfFile,(fileName)=>{
// let fileText = fs.readFileSync(fileName,'utf-8');
// })
// //检查本文件是否被改动
// hashElement('./scripts/mdToVue.js').then(hash => {
// if(fileText){
// //如果有内容
// callback({
// fileText:fileText,
// cachePath:cachePath
// })
// }else{
// pushHash(hash)
// fs.writeFileSync(cachePath,outhash.join('|'),'utf-8');
// //如果没有内容
// callback({
// fileText:fileText,
// cachePath:cachePath
// })
// }
// })
// .catch(error => {
// return console.error('hashing failed:', error);
// });
// }
/**
*
* @param {entry} 文件读取路径
Expand Down
4 changes: 2 additions & 2 deletions sites/doc/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import backtop from './compents/backtop/backtop.js';
import './compents/backtop/backtop.css';
backtop.install(Vue);
import 'highlight.js/styles/github.css';


import VueStickto from './compents/vue-stickto/VueStickto.js';
Vue.use(VueStickto)
import codes from 'qrcode';


Expand Down
44 changes: 30 additions & 14 deletions sites/doc/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
</div>
<div class="md-swaper" @click="clearSearch" v-else>
<div class="hder">
<div class="logo">
<div class="logo">
<a href="#/index" class="logo-link">
<img src="./asset/css/i/nut.png" alt>
</a>
<span class="version">v{{version}}</span>
</div>
<div class="h-nav">

<search/>
<ul class="list">
<li class="cur">
Expand Down Expand Up @@ -42,10 +43,10 @@
</div>
</div>
<div class="demo-wrapper">
<router-view class="demo-nav"></router-view>
<router-view class="demo-nav fixed-box"></router-view>

<keep-alive include="index">
<router-view class="doc-cont" :class="showPhone?'':'docpad'" name="main"></router-view>
<router-view class="doc-cont fl-right" :class="showPhone?'':'docpad'" name="main"></router-view>
</keep-alive>
<div v-if="showPhone" class="showPhone">
<div class="ph">
Expand Down Expand Up @@ -81,22 +82,22 @@
import "./asset/css/common.scss";
import "./asset/css/style-blue.scss";
import { packages } from "../../src/config.json";
import { version } from "../../package.json";
import search from "./search.vue";
import leftNav from './info.vue'
import leftNav from './info.vue';
import { version } from "../../package.json";
export default {
name: "App",
data() {
return {
packages,
version,
searchList: [],
searchVal: "",
routerName: "",
showPhone: false,
searchCurName: "",
searchIndex: 0,
codeurl: "",
version
codeurl: ""
};
},
watch: {
Expand Down Expand Up @@ -203,6 +204,16 @@ export default {
};
</script>
<style lang="scss">
.fixed-box{
position: fixed;
z-index: 9;
height: 100%;
overflow:hidden;
overflow-y: auto;
top:0;
background: #fff;
box-sizing: border-box;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
Expand All @@ -218,12 +229,12 @@ export default {
background: #fff;
min-height: 100vh;
min-width: 1000px;
padding: 115px 0 200px 0;
padding: 85px 0 200px 0;
box-sizing: border-box;
display: flex;
}
.hder {
position: absolute;
position: fixed;
top: 0;
width: 100%;
background: #ffffff;
Expand All @@ -233,13 +244,13 @@ export default {
align-items: center;
margin-bottom: 50px;
z-index: 42;
.logo {
width: 295px;
height: 65px;
border-right: 1px solid #d8d8d8;
.logo {
width: 293px;
height: 65px;
display: flex;
align-items: center;
flex-shrink: 0;
border-right: 1px solid #d8d8d8;
.logo-link {
display: inline-block;
}
Expand All @@ -264,7 +275,7 @@ export default {
display: flex;
padding-left: 42px;
align-items: center;
width: 100%;
width: 100%;
select {
width: 74px;
height: 28px;
Expand Down Expand Up @@ -432,6 +443,9 @@ export default {
}
}
}
.fl-right{
margin-left: 320px;
}
}
.foot {
height: 120px;
Expand All @@ -444,6 +458,8 @@ export default {
position: absolute;
bottom: 0;
width: 100%;
padding-left: 300px;
box-sizing: border-box;
a {
color: #fff;
text-decoration: none;
Expand Down
1 change: 1 addition & 0 deletions sites/doc/compents/vue-stickto/VueStickto.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 805414b

Please sign in to comment.