Skip to content

Commit

Permalink
Update: antoman 组件化开发/第二步:创建通用组件slider 命令应该是:automan-cli -p common/sl…
Browse files Browse the repository at this point in the history
…ider
  • Loading branch information
qiilee committed Sep 29, 2018
1 parent 00999f2 commit 99cea25
Show file tree
Hide file tree
Showing 29 changed files with 217 additions and 2 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>slider</div>
13 changes: 13 additions & 0 deletions uyi2/automan/browser/pages/components/common/slider/slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use([], function() {
Vue.component('sliderComponent', {
pageName: "common",
template: "pages/components/common/slider/slider.html",
data:function() {
return {}
},
created: function() {},
mounted: function() {},
destroyed: function() {},
methods: {}
});
});
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>hello 私有 banner</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use([], function() {
Vue.component('bannerComponent', {
pageName: "jiaofei/index",
template: "pages/components/jiaofei/index/banner/banner.html",
data:function() {
return {}
},
created: function() {},
mounted: function() {},
destroyed: function() {},
methods: {}
});
});
2 changes: 1 addition & 1 deletion uyi2/automan/browser/pages/index/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% include header.html %>
<template>
<div id="content-box">
hello world!
123
</div>
</template>
<% include footer.html %>
Empty file.
8 changes: 8 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/index/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% include header.html %>
<template>
<div id="content-box">
<sliderComponent></sliderComponent>
<bannerComponent></bannerComponent>
</div>
</template>
<% include footer.html %>
21 changes: 21 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/index/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use([
"pages/jiaofei/index/indexService",
"pages/components/jiaofei/index/banner/banner",
"pages/components/common/slider/slider"
], function() {
function init(storage) {
var app = new VueRoot({
template: 'pages/jiaofei/index/index.html',
data: storage,
created: function() {},
mounted: function() {},
methods: {}
});
return app;
}
module.exports = init;
if(typeof window != "undefined") {
var mainComponent = init(storage);
mainComponent.$mount("#automan-view");
}
});
4 changes: 4 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/index/indexService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var indexService = {
urls: {}
}
module.exports = indexService;
Empty file.
7 changes: 7 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/pay/pay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% include header.html %>
<template>
<div id="content-box">

</div>
</template>
<% include footer.html %>
19 changes: 19 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/pay/pay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use([
"pages/jiaofei/pay/payService"
], function() {
function init(storage) {
var app = new VueRoot({
template: 'pages/jiaofei/pay/pay.html',
data: storage,
created: function() {},
mounted: function() {},
methods: {}
});
return app;
}
module.exports = init;
if(typeof window != "undefined") {
var mainComponent = init(storage);
mainComponent.$mount("#automan-view");
}
});
4 changes: 4 additions & 0 deletions uyi2/automan/browser/pages/jiaofei/pay/payService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var payService = {
urls: {}
}
module.exports = payService;
Empty file.
7 changes: 7 additions & 0 deletions uyi2/automan/browser/pages/user/detail/detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% include header.html %>
<template>
<div id="content-box">

</div>
</template>
<% include footer.html %>
19 changes: 19 additions & 0 deletions uyi2/automan/browser/pages/user/detail/detail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use([
"pages/user/detail/detailService"
], function() {
function init(storage) {
var app = new VueRoot({
template: 'pages/user/detail/detail.html',
data: storage,
created: function() {},
mounted: function() {},
methods: {}
});
return app;
}
module.exports = init;
if(typeof window != "undefined") {
var mainComponent = init(storage);
mainComponent.$mount("#automan-view");
}
});
4 changes: 4 additions & 0 deletions uyi2/automan/browser/pages/user/detail/detailService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var detailService = {
urls: {}
}
module.exports = detailService;
Empty file.
7 changes: 7 additions & 0 deletions uyi2/automan/browser/pages/user/list/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% include header.html %>
<template>
<div id="content-box">

</div>
</template>
<% include footer.html %>
19 changes: 19 additions & 0 deletions uyi2/automan/browser/pages/user/list/list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use([
"pages/user/list/listService"
], function() {
function init(storage) {
var app = new VueRoot({
template: 'pages/user/list/list.html',
data: storage,
created: function() {},
mounted: function() {},
methods: {}
});
return app;
}
module.exports = init;
if(typeof window != "undefined") {
var mainComponent = init(storage);
mainComponent.$mount("#automan-view");
}
});
4 changes: 4 additions & 0 deletions uyi2/automan/browser/pages/user/list/listService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var listService = {
urls: {}
}
module.exports = listService;
2 changes: 1 addition & 1 deletion uyi2/automan/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"isUseGlobalCache": false,
"timestamp": 1538035668910,
"timestamp": 1538199136973,
"serverHost": "localhost",
"serverPort": "8001",
"protocal": "http",
Expand Down
10 changes: 10 additions & 0 deletions uyi2/automan/node/routes/jiaofei/index/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var async = require("async");
var fs = require("fs");
var browser = require(routesPath + "/common/browser").browser;
var renderEngin = require(routesPath + "/common/renderEngin");
exports.index = function(req, res) {
use(["pages/jiaofei/index/index", "pages/jiaofei/index/indexService"], function(app, indexService) {
var storage = {};
renderEngin.call(res, "jiaofei/index", app, browser.getPageTplPath(__dirname, "index"), storage);
},"jiaofei/index");
}
10 changes: 10 additions & 0 deletions uyi2/automan/node/routes/jiaofei/pay/pay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var async = require("async");
var fs = require("fs");
var browser = require(routesPath + "/common/browser").browser;
var renderEngin = require(routesPath + "/common/renderEngin");
exports.pay = function(req, res) {
use(["pages/jiaofei/pay/pay", "pages/jiaofei/pay/payService"], function(app, payService) {
var storage = {};
renderEngin.call(res, "jiaofei/pay", app, browser.getPageTplPath(__dirname, "pay"), storage);
},"jiaofei/pay");
}
10 changes: 10 additions & 0 deletions uyi2/automan/node/routes/user/detail/detail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var async = require("async");
var fs = require("fs");
var browser = require(routesPath + "/common/browser").browser;
var renderEngin = require(routesPath + "/common/renderEngin");
exports.detail = function(req, res) {
use(["pages/user/detail/detail", "pages/user/detail/detailService"], function(app, detailService) {
var storage = {};
renderEngin.call(res, "user/detail", app, browser.getPageTplPath(__dirname, "detail"), storage);
},"user/detail");
}
10 changes: 10 additions & 0 deletions uyi2/automan/node/routes/user/list/list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var async = require("async");
var fs = require("fs");
var browser = require(routesPath + "/common/browser").browser;
var renderEngin = require(routesPath + "/common/renderEngin");
exports.list = function(req, res) {
use(["pages/user/list/list", "pages/user/list/listService"], function(app, listService) {
var storage = {};
renderEngin.call(res, "user/list", app, browser.getPageTplPath(__dirname, "list"), storage);
},"user/list");
}
24 changes: 24 additions & 0 deletions uyi2/automan/node/routes/watch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@
"route": "/index",
"requestName": "index",
"url": "../routes/index/index"
},
{
"type": "get",
"route": "/jiaofei/index",
"requestName": "index",
"url": "../routes/jiaofei/index/index"
},
{
"type": "get",
"route": "/jiaofei/pay",
"requestName": "pay",
"url": "../routes/jiaofei/pay/pay"
},
{
"type": "get",
"route": "/user/detail",
"requestName": "detail",
"url": "../routes/user/detail/detail"
},
{
"type": "get",
"route": "/user/list",
"requestName": "list",
"url": "../routes/user/list/list"
}
]
}

0 comments on commit 99cea25

Please sign in to comment.