Skip to content

Dev #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["env", { "modules": false }]
]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
node_modules/
npm-debug.log
yarn-error.log
package-lock.json
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<p align="center">
<a href="http://nutui.jd.com">
<img alt="whistle logo" src="http://nutui.jd.com/asset/img/nutui-logo.png">
</a>
</p>
# NutUI
[![version](https://img.shields.io/badge/version-1.0-blue.svg)](http://nutui.jd.com/)
[![license](https://img.shields.io/badge/license-MIT-yellow.svg)](http://nutui.jd.com/)

> 基于Vue 2.0的移动端轻量级UI组件库

# 安装

``` bash
1、 使用npm安装nutui
npm install nutui --save
```

#### 引用完整组件库
``` bash
1、 在入口文件(如app.js)中引入
import NutUI from 'nutui'

2、 初始化
NutUI.install(Vue)
```


#### 按需引用
``` bash
import Mask from 'nutui/src/package/mask/index'

export default {
data(){
},
components: {
'nut-mask':Mask
},
methods:{
}
}
```
###### 按需引用需要注意,这种方式使用的是未编译的组件源码:
* 需要自行处理组件的依赖关系,将其依赖的组件先行引入
* 需要在自己的项目里使用babel对ES6编译
* 如果该组件用到了SCSS,则需要使用者自行处理vue单文件中的SCSS编译

# 组件用法
###### 组件从使用方法上大致分为两类。
* 一类是扩展 HTML 元素,典型的Vue组件形式,使用方式类似原生HTML元素。
``` bash
如遮罩层(Mask)组件,直接使用nut-mask标签即可
<nut-mask :visible="true"><nut-mask>
```
* 另一类是Vue构造器的扩展组件,使用方式类似jQuery/Zepto方法。
``` bash
如对话框(Dialog)组件
this.$dialog(options);
提示框(Toast)组件
this.$toast(msg,during);
```
每个组件的使用方式请参考具体组件[文档](http://nutui.jd.com/index.html#/intro)。

# License
[MIT](https://github.com/jdf2e/nutui/blob/master/LICENSE)
8 changes: 8 additions & 0 deletions dist/app.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/app.js.map

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

173 changes: 173 additions & 0 deletions dist/asset/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
body {
font-family: 'Microsoft YaHei';
}

a {
text-decoration: none;
}

a:hover {
color: #FF0000;
}

.sys-header {
height: 50px;
background: #FAFBFC;
border-bottom: 1px solid #E1E4E8;
}

.sys-header .sys-inner {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
}

.sys-logo {
background: url(../img/nutui-logo.png) no-repeat;
background-size: contain;
height: 36px;
width: 160px;
font-size: 0;
}

.sys-inner {
height: 100%;
}

.sys-menu {
display: none;
margin: 0;
}

.sys-menu li {
display: inline-block;
margin: 0 20px 0 0;
}

.sys-nav {
position: fixed;
top: 0;
left: 0;
height: 100%;
max-width: 90%;
min-width: 200px;
z-index: 100;
overflow-y:auto;
background: #FAFBFC;
box-sizing: border-box;
padding: 20px;
border-right: 1px solid #E1E4E8;
}

.sys-footer {
height: 50px;
font-size: 12px;
text-align: center;
border-top: 1px solid #E1E4E8;
}

.sys-footer .sys-inner {
line-height: 50px;
}

.sys-footer a {
color: inherit;
}

.sys-footer span {
display: inline-block;
height: 50px;
line-height: 50px;
margin: 0 auto;
padding-left: 34px;
background: url(../img/nutui-logo2.png) left center no-repeat;
background-size: 25px;
}

.sys-container {
min-height: 400px;
max-width: 1200px;
}

.sys-main {
padding: 10px;
}

.sys-main .tbl-wrapper {
width: 100%;
overflow-x: auto;
}

@media (max-width: 400px) {
.phone {
display: none;
}
.sys-header .sys-inner {
padding: 0 10px;
}
.qc-box {
display: none;
}
}

.nutdemo {
display: none;
}

@media (min-width: 400px) {
.sys-box {
min-width: 1300px
}
.nutdemo {
display: list-item;
}
.sys-header {
height: 100px;
padding: 0 50px;
}
.sys-header .sys-nav-btn {
display: none;
}
.sys-logo {
height: 60px;
}
.sys-menu {
display: inline-block;
}
.sys-container {
display: flex;
min-width: 1200px;
min-height: 800px;
margin: 15px auto;
padding: 0px 50px;
}
.sys-main {
flex: 1;
overflow: hidden;
padding: 0;
}
.sys-nav {
display: block !important;
position: static;
width: 270px;
z-index: 0;
overflow-y:hidden;
padding: 0 30px 0 0;
box-sizing: content-box;
background: none;
border: none;
}
.sys-inner {
max-width: 1200px;
margin: 0 auto;
}
}

.button,
button,
input[type="submit"],
input[type="reset"],
input[type="button"]{
font-size:12px;
}
88 changes: 88 additions & 0 deletions dist/asset/css/monokai-sublime.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*

Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/

*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #23241f;
}

.hljs,
.hljs-tag,
.hljs-subst {
color: #f8f8f2;
}

.hljs-strong,
.hljs-emphasis {
color: #a8a8a2;
}

.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
color: #ae81ff;
}

.hljs-code,
.hljs-title,
.hljs-section,
.hljs-selector-class {
color: #a6e22e;
}

.hljs-strong {
font-weight: bold;
}

.hljs-emphasis {
font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-name,
.hljs-attr {
color: #f92672;
}

.hljs-symbol,
.hljs-attribute {
color: #66d9ef;
}

.hljs-params,
.hljs-class .hljs-title {
color: #f8f8f2;
}

.hljs-string,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-variable {
color: #e6db74;
}

.hljs-comment,
.hljs-deletion,
.hljs-meta {
color: #75715e;
}

code {
font-family: Menlo, Monaco, Consolas, "Andale Mono", "lucida console", "Courier New", monospace;
font-size:100%;
}
Loading