@@ -27,6 +27,7 @@ export function usePluginConfig(emit?: any)
2727 const activeTab = ref ( 'general' )
2828 const tabsPluginData = ref < TabData [ ] > ( [ ] )
2929 const globalConfig = ref < any > ( null )
30+ const isInitialLoad = ref ( true )
3031
3132 const pluginConfig = ref < PluginConfig > ( {
3233 enabled : true ,
@@ -82,6 +83,8 @@ export function usePluginConfig(emit?: any)
8283 // 处理标签页切换
8384 const handleTabChange = ( ) => {
8485 if ( globalConfig . value && globalConfig . value . plugins && activePlugin . value ) {
86+ isInitialLoad . value = true
87+
8588 const foundPlugin = globalConfig . value . plugins . find (
8689 ( plugin : any ) => plugin . language === activePlugin . value
8790 )
@@ -104,6 +107,10 @@ export function usePluginConfig(emit?: any)
104107 timeout : 30
105108 }
106109 }
110+
111+ setTimeout ( ( ) => {
112+ isInitialLoad . value = false
113+ } , 100 )
107114 }
108115 }
109116
@@ -238,7 +245,7 @@ export function usePluginConfig(emit?: any)
238245
239246 // 监听插件配置变化
240247 watch ( pluginConfig , ( newConfig , oldConfig ) => {
241- if ( oldConfig && newConfig . language ) {
248+ if ( ! isInitialLoad . value && oldConfig && newConfig . language ) {
242249 console . log ( '插件配置变化:' , oldConfig , '->' , newConfig )
243250 debouncedUpdate ( newConfig )
244251 }
0 commit comments