<template>
<div>
111111
</div>
</template>
<style>
</style>
<script>
var stream = require('@weex-module/stream') || {}
var SEARCH_URL = 'https://api.github.com/search/repositories?q=language:javascript&sort=stars&order=desc&page=1'
module.exports = {
data: {
isLoaded: true,
page: 1,
loadingDisplay: 'hide',
refreshDisplay: 'hide',
loadingText: 'Loading...',
items:[]
},
created: function () {
// var url = SEARCH_URL
var url = 'http://www.ssgo.com/services/manage/getManage'
this.renderData(url)
},
methods: {
renderData: function (url) {
alert(url)
var self = this
stream.fetch({
method: 'POST',
url: url,
type:'text'
}, function(res) {
try {
// var results = res.data.items || []
var status = res.status
var results = res.data
alert(status)
alert(results)
if (Array.isArray(results)) {
for(var i = 0; i < results.length; i++) {
// self.items.push(results[i])
}
}
} catch(e) {}
},function(res){
})
},
}
}
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…