0.0.3 • Published 1 year ago

@system-plugin/notice-vue2 v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

插件配置接入简要说明

本插件适用于 Vue2.x 构建的应用,主要用于应用外挂插件...

接入说明

  • 前端
  1. 安装依赖
npm install @system-plugin/notice-vue2
  1. 引入
// main.js
import NoticePlugin from '@system-plugin/notice-vue2'
import '@system-plugin/notice-vue2/lib/ds_platform_plugin.css'
Vue.use(NoticePlugin)
  1. 使用
<!-- Layout/index.vue2 -->
<template>
  <div id="Layout">
    <!-- ... -->
    <system-notifica :ucToken="ucToken" :userId="userId" :wsUrl='wsUrl' @refreshToken="refreshToken" />
  </div>
</template>

<script>
import { getToken } from '@/utils/auth'
export default {
  name: 'Layout',
  data() {
    return {
      ucToken: getToken(), // 统一用户中心 token
      userId: 'xxx', // 用户 id
      wsUrl: 'xxx.xx.xx.xx:8080' // ws 地址
    }
  },
  methods: {
    // 刷新统一用户中心 token
    refreshToken() {
      // ...todo
    }
  }
}
</script>