一、获取DOM

使用ref属性

  1. <div ref="test">hello</div>
  2. this.$refs.test //可以获取

二、生命周期

  1. <div id="app">
  2. </div>
  3. <script>
  4. /* vue-ui框架 */
  5. /* created,mounted,updated,destoryed */
  6. new Vue({
  7. el:"#app",
  8. data:{
  9. movies:[]
  10. },
  11. mounted(){
  12. $.ajax({
  13. url:"http://192.168.4.20:8000/top250"
  14. }).then(res=>{
  15. console.log(res.result)
  16. })
  17. }
  18. })
  19. </script>