1.0.1 • Published 1 year ago

notice-tool-base-static v1.0.1

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

notice-tool-base-static

在静态资源管理系统上传 JSON 配置文件

JSON 结构如下

{
	appName: string ;  // 接入的应用名称
	label?: string; // 展示的文本, 默认为:系统维护中,请稍后...
	title?: string;  //展示的标题, 默认不展示标题
}

如:

{
  "appName": "供应链后台",
  "label": "测试公告,测试公告"
}

安装

pnpm add notice-tool-base-static

使用

// 函数式
import { createNotice } from 'notice-tool-base-static';

/**
 * createNotice 参数类型
 * {
 *  jsonUrl: string; // json 文件在静态资源管理系统中的 url
 *  time?: number; // 公告展示时长,单位毫秒,默认值 5000
 *  closeable?: boolean; // 公告是否可关闭,默认不可关闭,设置为可关闭后,忽略 time
 *  type?: string; // 公告类型,共四种类型:warning | error | info | success,默认为: warning
 * }
*/
createNotice({
  jsonUrl: 'https://m.xiwang.com/resource/__private__/6d81fbe53d6f2c242cf046ceb3b049cf/lcx/test.json',
  type: 'info',
  closeable: true,
})
1.0.1

1 year ago