<script>
import { ref } from "vue";
import { DingBlockMarket } from "dingblock-market-vue";
const theme = ref("dark");
const market = ref();
// 退出登录需调用cancelAuth
const handleLogout = () => {
market.value?.cancelAuth?.();
};
// 切换主题直接修改
const handleChangeTheme = (value) => {
theme.value = value;
};
const auth = async () => {
return "DINGBLOCK_AUTH_TOKEN";
};
const check = () => {
return 'USER_ID'
}
const onRedirect = (link) => {
window.location.href = link;
};
</script>
<template>
<DingblockMarket
@redirect="onRedirect"
ref="dingblock"
:theme="theme"
appId="YOUR_APPID"
:auth="auth"
:check="check"
/>
</template>