<el-tabs v-model="activeName">
<el-tab-pane v-for="(html, name) in pluginList" :label="name">
<component :is="asyncCpt" :http="$http" />
</el-tab-pane>
</el-tabs>
const activeName = ref('');
const asyncCpt = ref(null);
watch(activeName, async (newVal) => {
asyncCpt.value = defineAsyncComponent(() => {
return new Promise((resolve, reject) => {
$http.post('/api/plugin/settings/' + newVal + '/index').then((res) => {
if (res.data != null && res.data != '') {
resolve(res.data);
} else {
reject('Plugin Load Error!');
}
});
});
});
}); |