PluginSettings.vue 792 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <div id="main">
  3. <el-tabs>
  4. <el-tab-pane v-for="(src, name) in pluginList" :label="name">
  5. <iframe :src="src"></iframe>
  6. </el-tab-pane>
  7. </el-tabs>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { reactive, ref, getCurrentInstance } from 'vue'
  12. const app = getCurrentInstance()
  13. const $http = app.appContext.config.globalProperties.$http
  14. const pluginList = reactive({})
  15. $http.get('/api/plugin/list').then(res => {
  16. if (res.data != null && res.data.length > 0) {
  17. for (let i = 0; i < res.data.length; i++) {
  18. let name = res.data[i];
  19. pluginList[name] = "/api/plugin/settings/"+ name +"/index.html";
  20. }
  21. }
  22. })
  23. </script>
  24. <style scoped>
  25. iframe{
  26. width: 100%;
  27. border: 0;
  28. }
  29. </style>