mobile style

This commit is contained in:
cookfront 2017-03-17 15:39:20 +08:00
parent 9ccce7cd5c
commit 6b57cd1866
12 changed files with 201 additions and 133 deletions

View File

@ -4,6 +4,9 @@
<i class="zan-icon zan-icon-arrow"></i>
</router-link>
<router-view></router-view>
<div class="footer">
<img src="https://b.yzcdn.cn/v2/image/wap/zanui-logo.png" alt="logo" class="zanui-logo">
</div>
</div>
</template>
@ -43,8 +46,16 @@ export default {
text-decoration: none;
}
body, html {
height: 100%;
}
.examples-container {
padding-bottom: 30px;
padding-bottom: 40px;
height: 100%;
overflow: auto;
background: #f9fafb;
position: relative;
}
.page-back {
@ -76,4 +87,18 @@ export default {
font-size: 16px;
padding: 10px 15px;
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
padding-bottom: 15px;
}
.zanui-logo {
display: block;
margin: 0 auto;
width: 150px;
height: auto;
}
</style>

2
docs/build/0.js vendored

File diff suppressed because one or more lines are too long

2
docs/build/1.js vendored
View File

@ -1 +1 @@
webpackJsonp([1],{259:function(t,e,a){a(481);var i=a(0)(a(273),a(423),null,null);t.exports=i.exports},273:function(t,e,a){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=a(30),s=i(n);e.default={data:function(){return{highlights:[],navState:[],data:s.default["zh-CN"],base:"/component"}}}},323:function(t,e,a){e=t.exports=a(16)(),e.push([t.i,".side-nav{width:100%;box-sizing:border-box;padding:40px 20px;background:#f9fafb}.side-nav li{list-style:none}.side-nav ul{padding:0;margin:0;overflow:hidden}.side-nav .nav-item a{font-size:16px;color:#5e6d82;line-height:40px;height:40px;margin:0;padding:0;text-decoration:none;display:block;position:relative;-webkit-transition:all .3s;transition:all .3s}.side-nav .nav-item a.active{color:#20a0ff}.side-nav .nav-item .nav-item a{display:block;height:40px;line-height:40px;font-size:13px;padding-left:24px}.side-nav .nav-item .nav-item a:hover{color:#20a0ff}.side-nav .nav-group__title{font-size:12px;color:#99a9bf;padding-left:8px;line-height:26px;margin-top:10px}",""])},423:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"side-nav"},[a("ul",t._l(t.data,function(e){return a("li",{staticClass:"nav-item"},[e.path?a("router-link",{attrs:{"active-class":"active",to:t.base+e.path,exact:""},domProps:{textContent:t._s(e.title||e.name)}}):a("a",[t._v(t._s(e.name))]),t._v(" "),e.children?a("ul",{staticClass:"pure-menu-list sub-nav"},t._l(e.children,function(e){return a("li",{staticClass:"nav-item"},[a("router-link",{attrs:{"active-class":"active",to:t.base+e.path},domProps:{textContent:t._s(e.title||e.name)}})],1)})):t._e(),t._v(" "),e.groups?t._l(e.groups,function(e){return a("div",{staticClass:"nav-group"},[a("div",{staticClass:"nav-group__title"},[t._v(t._s(e.groupName))]),t._v(" "),a("ul",{staticClass:"pure-menu-list"},[t._l(e.list,function(e){return[e.disabled?t._e():a("li",{staticClass:"nav-item"},[a("router-link",{attrs:{"active-class":"active",to:t.base+e.path},domProps:{textContent:t._s(e.title)}})],1)]})],2)])}):t._e()],2)}))])},staticRenderFns:[]}},481:function(t,e,a){var i=a(323);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);a(31)("1517d9c0",i,!0)}});
webpackJsonp([1],{259:function(t,e,a){a(481);var i=a(0)(a(273),a(423),null,null);t.exports=i.exports},273:function(t,e,a){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=a(30),s=i(n);e.default={data:function(){return{highlights:[],navState:[],data:s.default["zh-CN"],base:"/component"}}}},323:function(t,e,a){e=t.exports=a(17)(),e.push([t.i,".side-nav{width:100%;box-sizing:border-box;padding:40px 20px;background:#f9fafb}.side-nav li{list-style:none}.side-nav ul{padding:0;margin:0;overflow:hidden}.side-nav .nav-item a{font-size:16px;color:#5e6d82;line-height:40px;height:40px;margin:0;padding:0;text-decoration:none;display:block;position:relative;-webkit-transition:all .3s;transition:all .3s}.side-nav .nav-item a.active{color:#20a0ff}.side-nav .nav-item .nav-item a{display:block;height:40px;line-height:40px;font-size:13px;padding-left:24px}.side-nav .nav-item .nav-item a:hover{color:#20a0ff}.side-nav .nav-group__title{font-size:12px;color:#99a9bf;padding-left:8px;line-height:26px;margin-top:10px}",""])},423:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"side-nav"},[a("ul",t._l(t.data,function(e){return a("li",{staticClass:"nav-item"},[e.path?a("router-link",{attrs:{"active-class":"active",to:t.base+e.path,exact:""},domProps:{textContent:t._s(e.title||e.name)}}):a("a",[t._v(t._s(e.name))]),t._v(" "),e.children?a("ul",{staticClass:"pure-menu-list sub-nav"},t._l(e.children,function(e){return a("li",{staticClass:"nav-item"},[a("router-link",{attrs:{"active-class":"active",to:t.base+e.path},domProps:{textContent:t._s(e.title||e.name)}})],1)})):t._e(),t._v(" "),e.groups?t._l(e.groups,function(e){return a("div",{staticClass:"nav-group"},[a("div",{staticClass:"nav-group__title"},[t._v(t._s(e.groupName))]),t._v(" "),a("ul",{staticClass:"pure-menu-list"},[t._l(e.list,function(e){return[e.disabled?t._e():a("li",{staticClass:"nav-item"},[a("router-link",{attrs:{"active-class":"active",to:t.base+e.path},domProps:{textContent:t._s(e.title)}})],1)]})],2)])}):t._e()],2)}))])},staticRenderFns:[]}},481:function(t,e,a){var i=a(323);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);a(31)("1517d9c0",i,!0)}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,49 +1,20 @@
<template>
<div class="side-nav">
<ul>
<li class="nav-item" v-for="item in data">
<a v-if="!item.path">{{item.name}}</a>
<router-link
v-else
active-class="active"
:to="base + item.path"
exact
v-text="item.title || item.name">
</router-link>
<ul class="pure-menu-list sub-nav" v-if="item.children">
<li class="nav-item" v-for="navItem in item.children">
<router-link
active-class="active"
:to="base + navItem.path"
v-text="navItem.title || navItem.name">
</router-link>
</li>
</ul>
<template v-if="item.groups">
<div class="nav-group" v-for="group in item.groups">
<div class="nav-group__title">{{group.groupName}}</div>
<ul class="pure-menu-list">
<template v-for="navItem in group.list">
<li
class="nav-item"
v-if="!navItem.disabled">
<router-link
active-class="active"
:to="base + navItem.path"
v-text="navItem.title">
</router-link>
</li>
</template>
</ul>
</div>
</template>
</li>
</ul>
<h1 class="zanui-title">Zan UI Wap</h1>
<h2 class="zanui-desc">有赞移动wap端组件库</h2>
<div class="mobile-navs">
<template v-for="item in data">
<div class="mobile-nav-item" v-if="item.showInMobile">
<mobile-nav v-for="group in item.groups" :group="group" :base="base"></mobile-nav>
</div>
</template>
</div>
</div>
</template>
<script>
import navConfig from '../nav.config.json';
import MobileNav from './mobile-nav';
export default {
data() {
@ -53,6 +24,10 @@ export default {
data: navConfig['zh-CN'],
base: '/component'
};
},
components: {
MobileNav
}
};
</script>
@ -61,56 +36,25 @@ export default {
.side-nav {
width: 100%;
box-sizing: border-box;
padding: 40px 20px;
background: #f9fafb;
padding: 90px 15px 20px;
position: relative;
z-index: 1;
li {
list-style: none;
}
ul {
padding: 0;
margin: 0;
overflow: hidden;
.zanui-title,
.zanui-desc {
text-align: center;
font-weight: normal;
}
.nav-item {
a {
font-size: 16px;
color: #5e6d82;
line-height: 40px;
height: 40px;
margin: 0;
padding: 0;
text-decoration: none;
display: block;
position: relative;
transition: all .3s;
&.active {
color: #20a0ff;
}
}
.nav-item {
a {
display: block;
height: 40px;
line-height: 40px;
font-size: 13px;
padding-left: 24px;
&:hover {
color: #20a0ff;
}
}
}
.zanui-title {
font-size: 26px;
color: #333;
}
.nav-group__title {
font-size: 12px;
color: #99a9bf;
padding-left: 8px;
line-height: 26px;
margin-top: 10px;
.zanui-desc {
font-size: 14px;
color: #666;
margin-bottom: 50px;
}
}
</style>

View File

@ -0,0 +1,94 @@
<template>
<div class="mobile-nav-group">
<div
class="mobile-nav-group__title"
:class="{
'mobile-nav-group__title--open': isOpen
}"
@click="isOpen = !isOpen">
{{group.groupName}}
</div>
<ul class="pure-menu-list" v-show="isOpen">
<template v-for="navItem in group.list">
<li
class="mobile-nav-group__title"
v-if="!navItem.disabled">
<router-link
active-class="active"
:to="base + navItem.path"
v-text="navItem.title">
</router-link>
<zan-icon name="arrow"></zan-icon>
</li>
</template>
</ul>
</div>
</template>
<script>
export default {
props: {
group: {
type: Array,
default: () => {
return [];
}
},
base: String
},
data() {
return {
isOpen: false
};
}
};
</script>
<style>
@component-namespace mobile {
@b nav-group {
border-radius: 2px;
margin-bottom: 15px;
padding-left: 20px;
background-color: #fff;
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.10);
@e title {
font-size: 16px;
color: #333;
line-height: 56px;
position: relative;
@m open {
color: #999;
}
a {
color: #333;
display: block;
border-top: 1px solid #e5e5e5;
}
.zan-icon-arrow {
position: absolute;
font-size: 12px;
line-height: 1;
top: 24px;
right: 20px;
}
}
li {
list-style: none;
}
ul {
padding: 0;
margin: 0;
overflow: hidden;
}
}
}
</style>

View File

@ -33,13 +33,15 @@ export default {
<style>
.mobile-popup {
width: 380px;
height: 500px;
border: 5px solid #e5e5e5;
width: 375px;
height: 650px;
background: url(https://b.yzcdn.cn/v2/image/wap/zanui-mobile-container.png) no-repeat;
}
.mobile-popup-iframe {
width: 100%;
height: 500px;
position: relative;
top: 64px;
height: 586px;
}
</style>

View File

@ -23,6 +23,8 @@
<zan-icon name="gift"></zan-icon>
<zan-icon name="search"></zan-icon>
<zan-icon name="clear"></zan-icon>
<zan-icon name="success"></zan-icon>
<zan-icon name="fail"></zan-icon>
</example-block></section></template>
<style>

View File

@ -1,6 +1,8 @@
<template><section class="demo-image-preview"><h1 class="demo-title">image-preview</h1><example-block title="">
<zan-button @click="handleImagePreview">预览图片</zan-button>
</example-block></section></template>
<script>
@ -12,8 +14,7 @@ export default {
handleImagePreview() {
ImagePreview([
'https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg?imageView2/2/w/980/h/980/q/75/format/webp',
'https://img.yzcdn.cn/upload_files/2017/03/15/FvexrWlG_WxtCE9Omo5l27n_mAG_.jpeg?imageView2/2/w/980/h/980/q/75/format/webp',
'https://img.yzcdn.cn/upload_files/2017/03/15/FkubrzN7AgGwLlTeb1E89-T_ZjBg.png'
'https://img.yzcdn.cn/upload_files/2017/03/15/FvexrWlG_WxtCE9Omo5l27n_mAG_.jpeg?imageView2/2/w/980/h/980/q/75/format/webp'
]);
}
}

View File

@ -19,9 +19,10 @@
},
{
"name": "ZanUI组件",
"showInMobile": true,
"groups": [
{
"groupName": "CSS组件",
"groupName": "基础组件",
"list": [
{
"path": "/button",
@ -63,14 +64,42 @@
"path": "/badge",
"title": "Badge"
},
{
"path": "/tab",
"title": "Tab"
},
{
"path": "/lazyload",
"title": "Lazyload"
},
{
"path": "/popup",
"title": "Popup"
},
{
"path": "/swipe",
"title": "Swipe"
},
{
"path": "/search",
"title": "Search"
},
{
"path": "/quantity",
"title": "Quantity"
},
{
"path": "/waterfall",
"title": "Waterfall"
},
{
"path": "/image-preview",
"title": "ImagePreview"
}
]
},
{
"groupName": "Form",
"groupName": "表单",
"list": [
{
"path": "/switch",
@ -87,28 +116,24 @@
{
"path": "/checkbox",
"title": "Checkbox"
},
{
"path": "/uploader",
"title": "Uploader"
}
]
},
{
"groupName": "JS组件",
"groupName": "操作反馈",
"list": [
{
"path": "/actionsheet",
"title": "ActionSheet"
},
{
"path": "/tab",
"title": "Tab"
},
{
"path": "/toast",
"title": "Toast"
},
{
"path": "/uploader",
"title": "Uploader"
},
{
"path": "/picker",
"title": "Picker"
@ -117,33 +142,9 @@
"path": "/datetime-picker",
"title": "Datetime Picker"
},
{
"path": "/lazyload",
"title": "Lazyload"
},
{
"path": "/popup",
"title": "Popup"
},
{
"path": "/dialog",
"title": "Dialog"
},
{
"path": "/swipe",
"title": "Swipe"
},
{
"path": "/quantity",
"title": "Quantity"
},
{
"path": "/waterfall",
"title": "Waterfall"
},
{
"path": "/image-preview",
"title": "ImagePreview"
}
]
}

View File

@ -31,8 +31,7 @@
}
@m error {
.zan-field__control,
.zan-cell__title {
.zan-field__control {
color: $c-red;
}
}