️ emits 真好用x

This commit is contained in:
目棃
2024-01-27 19:54:00 +08:00
parent 65063424db
commit a30d8e3a28
5 changed files with 118 additions and 38 deletions

View File

@@ -46,7 +46,7 @@
</div>
<div class="config-right">
<TcAppBadge />
<TcUserBadge />
<TcUserBadge @loadOuter="loadHandle" />
</div>
</template>
@@ -412,6 +412,17 @@ function submitDevMode(): void {
? showSnackbar({ text: "已关闭 dev 模式!" })
: showSnackbar({ text: "已开启 dev 模式!" });
}
// 通过子组件的事件来控制 loading
function loadHandle(params: TGApp.Component.Loading.EmitParams): void {
loading.value = params.show;
if (params.title) {
loadingTitle.value = params.title;
}
if (params.text) {
loadingSub.value = params.text;
}
}
</script>
<style lang="css" scoped>
.config-box {