Archived
t-tabs 用官方 list prop 数据驱动(受控 value + 动态增删语义干净);请求纯手动触发,enabled 门控 + refetch,staleTime Infinity 切 tab 不重发,queryKey ['endpoint', path, skKey] 换 key 即新查询;endpoint-panel 的 sk-key computed 读写 store,切 tab 输入保留。
34 lines
760 B
TypeScript
34 lines
760 B
TypeScript
import { createApp } from 'vue';
|
||
import { VueQueryPlugin } from '@tanstack/vue-query';
|
||
import { createPinia } from 'pinia';
|
||
|
||
import TDesign from 'tdesign-vue-next';
|
||
import 'tdesign-vue-next/es/style/index.css';
|
||
|
||
import App from './App.vue';
|
||
import './style.css';
|
||
|
||
const app = createApp(App);
|
||
|
||
app.use(createPinia());
|
||
|
||
// TanStack Query:调试工具语义——不自动重取、失败不重试(详见 endpoint-queries.ts)
|
||
app.use(VueQueryPlugin, {
|
||
queryClientConfig: {
|
||
defaultOptions: {
|
||
queries: {
|
||
staleTime: Infinity,
|
||
gcTime: Infinity,
|
||
retry: false,
|
||
refetchOnWindowFocus: false,
|
||
refetchOnMount: false,
|
||
refetchOnReconnect: false,
|
||
},
|
||
},
|
||
},
|
||
});
|
||
|
||
app.use(TDesign);
|
||
|
||
app.mount('#app');
|