PluginConfig.vue 591 B

123456789101112131415161718192021222324
  1. <script setup lang="ts">
  2. import {ref} from 'vue'
  3. import {useRoute} from 'vue-router'
  4. import PluginConfigForm from './PluginConfigForm.vue';
  5. const route = useRoute()
  6. const pluginId = ref('system') // 默认值为 system
  7. // 立即获取路由参数,而不是在 onMounted 中获取
  8. if (route.query.plugin_id) {
  9. pluginId.value = route.query.plugin_id as string
  10. }
  11. // 监听路由参数变化,确保参数变化时更新插件ID
  12. const unwatch = () => {
  13. } // placeholder
  14. </script>
  15. <template>
  16. <plugin-config-form :plugin-id="pluginId"/>
  17. </template>
  18. <style scoped lang="scss">
  19. </style>