@system-plugin/notice-vue2

0.0.3 • Public • Published

插件配置接入简要说明

本插件适用于 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>

/@system-plugin/notice-vue2/

    Package Sidebar

    Install

    npm i @system-plugin/notice-vue2

    Weekly Downloads

    0

    Version

    0.0.3

    License

    none

    Unpacked Size

    102 kB

    Total Files

    10

    Last publish

    Collaborators

    • appcube
    • hhj1995515