Authored by 郭成尧

组件调用

... ... @@ -49,6 +49,10 @@ const component = {
{
id: 'E',
name: 'E'
},
{
id: 'F',
name: 'F'
}
]
);
... ...
... ... @@ -14,5 +14,6 @@ const router = expressRouter();
router.get('/', channel.index); // 首页
router.get('/brand', channel.brand); // 店铺首页
router.get('/brand/letterList', channel.letterList); // 店铺首页
module.exports = router;
... ...
... ... @@ -26,32 +26,22 @@
</style>
<script>
var $ = require('yoho-jquery');
module.exports = {
data: function () {
return {
items: [
{
id: 'A',
name: 'A'
},
{
id: 'B',
name: 'B'
},
{
id: 'C',
name: 'C'
},
{
id: 'D',
name: 'D'
},
{
id: 'E',
name: 'E'
}
]
items: []
}
},
init() {
$.ajax({
url: '/brand/letterList'
}).then(result => {
this.items = result;
}).fail(() => {
tip('网络错误');
});
}
};
... ...