vue-resource更换为axios
npm install axios
/*main.js*/
import axios from 'axios'
Vue.prototype.$ajax = axios
/*components*/
import axios from 'axios'

export default {
created () {
axios.get('./static/data.json').then(res => {
})
}
}
获取DOM
<div class="tab" ref="domList">
</div>
<script>
created () {
this.$nextTick(() => {
console.log(this.$refs.domList)
})
}
</script>

posted on 2017-10-23 23:43  webstrom10  阅读(239)  评论(0编辑  收藏  举报