Skip to content

Commit

Permalink
package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Levan-Du committed Jun 12, 2017
1 parent c54a4f5 commit 5749ea4
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 39 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "avalon-practice",
"name": "avalon-demo",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
Expand All @@ -13,7 +13,6 @@
"babel-loader": "^7.0.0",
"babel-preset-es2015": "^6.24.1",
"css-loader": "^0.27.3",
"html-minify-loader": "^1.1.0",
"html-webpack-plugin": "^2.28.0",
"html-withimg-loader": "^0.1.16",
"raw-loader": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ms-topbar />
</header>
<article class="content">
<ms-tab />
<ms-tabbar />
</article>
<footer class="footer">
<ms-statusbar />
Expand Down
4 changes: 3 additions & 1 deletion src/components/Menu/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<ul class="menu">
<li class="menu__item" ms-for="el in menus">{{el.title}}</li>
<li class="menu__item" ms-for="el in menus">
<ms-navlink ms-widget="{to:el.path,title:el.title}" />
</li>
</ul>
13 changes: 3 additions & 10 deletions src/components/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ import './index.css';
component('ms-menu', {
template: require('./index.html'),
defaults: {
menus: [{ id: 1, title: '菜单1', pid: 0 },
{ id: 2, title: '菜单2', pid: 0 },
{ id: 3, title: '菜单3', pid: 0 },
{ id: 4, title: '菜单4', pid: 0 },
{ id: 5, title: '菜单5', pid: 0 },
{ id: 6, title: '菜单6', pid: 0 },
{ id: 7, title: '菜单7', pid: 0 },
{ id: 8, title: '菜单8', pid: 0 },
{ id: 9, title: '菜单9', pid: 0 },
{ id: 10, title: '菜单10', pid: 0 }
menus: [
{ id: 1, title: 'page1', path: '/page1', pid: 0 },
{ id: 2, title: 'page2', path: '/page2', pid: 0 }
]
}
})
Empty file.
1 change: 1 addition & 0 deletions src/components/NavLink/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a ms-attr="{href:@to}" ms-text="@title" ></a>
10 changes: 10 additions & 0 deletions src/components/NavLink/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import avalon, { component } from 'avalon2';
import './index.css';

component('ms-navlink', {
template: require('./index.html'),
defaults: {
title: '',
to: ''
}
})
33 changes: 9 additions & 24 deletions src/components/Tab/index.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
<ul class="tab clearfix">
<li class="tab-item">
<input id="tab_check_0" type="radio" class="tab-check" name="tab_check" checked>
<label for="tab_check_0" class="tab-title">Home</label>
<span class="tab-line"></span>
<div class="tab-page">
<ms-homepage />
</div>
</li>
<li class="tab-item">
<input id="tab_check_1" type="radio" class="tab-check" name="tab_check">
<label for="tab_check_1" class="tab-title">page1</label>
<span class="tab-line"></span>
<div class="tab-page">
<ms-page1 />
</div>
</li>
<li class="tab-item">
<input id="tab_check_2" type="radio" class="tab-check" name="tab_check">
<label for="tab_check_2" class="tab-title">page2</label>
<span class="tab-line"></span>
<div class="tab-page">
<ms-page1 />
</div>
</li>
<ms-tabpage>
<ms-page1 slot="page" />
</ms-tabpage>
<ms-tabpage>
<ms-page2 slot="page" />
</ms-tabpage>
<ms-tabpage>
<ms-page2 slot="page" />
</ms-tabpage>
</ul>
15 changes: 15 additions & 0 deletions src/components/TabBar/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.tabbar {}

.tabbar .left {
float: left;
width: 2rem;
}

.tabbar .right {
float: right;
width: 2rem;
}

.tabbar .mid {
overflow: hidden;
}
4 changes: 3 additions & 1 deletion src/components/TabBar/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<ul class="tabbar">
<li><span class=""></span></li>
<li><span class="left"></span></li>
<li class="mid"><ms-tab /></li>
<li><span class="right"></span></li>
</ul>
Empty file.
8 changes: 8 additions & 0 deletions src/components/TabPage/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<li class="tab-item">
<input id="tab_check_0" type="radio" class="tab-check" name="tab_check" checked>
<label for="tab_check_0" class="tab-title">Home</label>
<span class="tab-line"></span>
<div class="tab-page">
<slot name="page" />
</div>
</li>
8 changes: 8 additions & 0 deletions src/components/TabPage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import avalon, { component } from 'avalon2';
import './index.css';

component('ms-tabpage', {
template: require('./index.html'),
defaults: {
}
})
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import './Main';
import './App';
import './Topbar';
import './StatusBar';
import './TabBar';
import './Tab';
import './TabPage';

0 comments on commit 5749ea4

Please sign in to comment.