MockPage.vue 926 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <div>
  3. <h5>mock数据显示</h5>
  4. <ul v-for="r in res">
  5. <li>{{r.id}}</li>
  6. </ul>
  7. </div>
  8. </template>
  9. <script>
  10. import global from '../Global.js'
  11. import { worldDetail } from '../api/getApiRes.js'
  12. export default {
  13. data() {
  14. return {
  15. res: []
  16. }
  17. },
  18. mounted() {
  19. this.getInfo();
  20. },
  21. methods: {
  22. getInfo() {
  23. const that = this;
  24. let param = {};
  25. worldDetail(param).then(res => {
  26. if (res.Code == 0) {
  27. that.res = res.Rs;
  28. } else {
  29. console.log(123);
  30. }
  31. })
  32. }
  33. }
  34. }
  35. </script>
  36. <style scoped>
  37. ul, li {
  38. list-style: none;
  39. padding: 0;
  40. margin: 0;
  41. }
  42. </style>