import Notice from '@polyv/interactions-launch-sdk-ui-default/lib/Notice';
<template>
<div>
<button @click="noticeVisible = true">公告</button>
<!-- 建议弹窗宽度为 560px,弹窗内容高度为 350px -->
<el-dialog
v-if="noticeCore"
class="c-interactions-lottery"
:custom-class="'c-interactions-dialog c-interactions-dialog__h350'"
width="560px"
title="公告"
:visible.sync="noticeVisible"
:close-on-click-modal="false"
>
<notice
:lang="lang"
:core="noticeCore"
/>
</el-dialog>
</div>
</template>
<script>
import * as InteractionsLaunchSDK from '@polyv/interactions-launch-sdk';
import Notice from '@polyv/interactions-launch-sdk-ui-default/lib/Notice';
export default {
components: {
Notice,
},
data() {
return {
// 中英文设置 'zh_CN'/'en'
lang: 'zh_CN',
noticeVisible: false,
// 公告 SDK 实例
noticeCore: null,
};
},
mounted() {
// TODO: 关于初始化 InteractionsLaunchSDK 的其他设置
this.noticeCore = new InteractionsLaunchSDK.Notice();
},
};
</script>