index.vue 613 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <el-alert v-if="enable()" type="success" show-icon>
  3. <template slot="title">
  4. <div @click="goToUrl">{{ '【' + title + '】文档地址:' + url }}</div>
  5. </template>
  6. </el-alert>
  7. </template>
  8. <script>
  9. import {getDocEnable} from "@/utils/ruoyi";
  10. export default {
  11. name: "DocAlert",
  12. props: {
  13. title: String,
  14. url: String,
  15. },
  16. methods: {
  17. enable: function () {
  18. return getDocEnable();
  19. },
  20. goToUrl: function() {
  21. window.open(this.url);
  22. }
  23. }
  24. };
  25. </script>
  26. <style scoped>
  27. .el-alert--success.is-light {
  28. margin-bottom: 10px;
  29. cursor: pointer;
  30. }
  31. </style>