index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div>
  3. <div>
  4. <div>title</div>
  5. <div>
  6. <button @click="$router.push('/inspire')">inspire</button>
  7. </div>
  8. <div class="justify-end">
  9. <button @click="getContentByType()">getContentByType</button>
  10. <button @click="message()">message</button>
  11. </div>
  12. </div>
  13. <div class="">{{ FILE_PREFIX }}</div>
  14. <img
  15. :src="
  16. $file.getUrl({
  17. fileKey: 'LowLevelMultipartUpload_18706407955405619211',
  18. type: 'popup',
  19. })
  20. "
  21. alt=""
  22. />
  23. </div>
  24. </template>
  25. <script>
  26. import agreement from '~/api/public/agreement.js';
  27. export default {
  28. name: 'IndexPage',
  29. auth: false,
  30. // asyncData({ $snackbar }) {
  31. // $snackbar({
  32. // app: true,
  33. // content: '123456798',
  34. // });
  35. // },
  36. data() {
  37. return {
  38. FILE_PREFIX: process.env.FILE_PREFIX,
  39. FILE_UPLOAD_KEY: process.env.FILE_UPLOAD_KEY,
  40. };
  41. },
  42. fetch() {},
  43. mounted() {},
  44. methods: {
  45. async getContentByType() {
  46. const data = await agreement(this).getContentByType('XYPZYHXY2004', 1);
  47. console.log(
  48. '🚀 ~ file: index.vue ~ line 24 ~ getContentByType ~ data',
  49. data,
  50. );
  51. },
  52. message() {
  53. this.$message({
  54. app: true,
  55. content: '123456798',
  56. icon: '$success',
  57. });
  58. },
  59. },
  60. };
  61. </script>