中生金域
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

2 years ago
2 years ago
2 years ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. data() {
  5. return {
  6. activeTab: 0
  7. };
  8. },
  9. onLoad() {
  10. common_vendor.index.request({
  11. url: "https://www.example.com/request",
  12. //仅为示例,并非真实接口地址。
  13. data: {
  14. text: "uni.request"
  15. },
  16. header: {
  17. "custom-header": "hello"
  18. //自定义请求头信息
  19. },
  20. success: (res) => {
  21. console.log(res.data);
  22. }
  23. });
  24. },
  25. methods: {
  26. changeActiveTab(activeTab) {
  27. this.activeTab = activeTab;
  28. }
  29. }
  30. };
  31. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  32. return common_vendor.e({
  33. a: $data.activeTab == 0
  34. }, $data.activeTab == 0 ? {} : {}, {
  35. b: $data.activeTab == 1
  36. }, $data.activeTab == 1 ? {
  37. c: common_vendor.f(10, (item, k0, i0) => {
  38. return {
  39. a: item
  40. };
  41. })
  42. } : {}, {
  43. d: common_vendor.n($data.activeTab == 0 ? "btn active" : "btn"),
  44. e: common_vendor.o(($event) => $options.changeActiveTab(0)),
  45. f: common_vendor.n($data.activeTab == 1 ? "btn active" : "btn"),
  46. g: common_vendor.o(($event) => $options.changeActiveTab(1))
  47. });
  48. }
  49. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/cool/Desktop/code/gold-field/pages/index/index.vue"]]);
  50. wx.createPage(MiniProgramPage);