chore: 包名改为 @metona-team/metona-toast,全文档更新引用
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
轻量、零依赖、精致美观的 Toast 通知库。
|
||||
|
||||
[](https://www.npmjs.com/package/metona-toast)
|
||||
[](https://bundlephobia.com/package/metona-toast)
|
||||
[](https://www.npmjs.com/package/@metona-team/metona-toast)
|
||||
[](https://bundlephobia.com/package/@metona-team/metona-toast)
|
||||
[](https://git.metona.cn/MetonaTeam/MetonaToast)
|
||||
|
||||
## 特性
|
||||
@@ -20,29 +20,29 @@
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
npm install metona-toast
|
||||
npm install @metona-team/metona-toast
|
||||
```
|
||||
|
||||
### 引用方式
|
||||
|
||||
```javascript
|
||||
// ES Module
|
||||
import MeToast from 'metona-toast';
|
||||
import MeToast from '@metona-team/metona-toast';
|
||||
|
||||
// CommonJS
|
||||
const MeToast = require('metona-toast');
|
||||
const MeToast = require('@metona-team/metona-toast');
|
||||
```
|
||||
|
||||
```html
|
||||
<!-- CDN UMD 开发版 -->
|
||||
<script src="https://unpkg.com/metona-toast@2.0.0/dist/metona-toast.js"></script>
|
||||
<script src="https://git.metona.cn/MetonaTeam/MetonaToast/raw/branch/master/dist/metona-toast.js"></script>
|
||||
|
||||
<!-- CDN 压缩版(生产环境推荐) -->
|
||||
<script src="https://unpkg.com/metona-toast@2.0.0/dist/metona-toast.min.js"></script>
|
||||
<script src="https://git.metona.cn/MetonaTeam/MetonaToast/raw/branch/master/dist/metona-toast.min.js"></script>
|
||||
|
||||
<!-- CDN ES Module -->
|
||||
<script type="module">
|
||||
import MeToast from 'https://unpkg.com/metona-toast@2.0.0/dist/metona-toast.esm.js';
|
||||
import MeToast from 'https://git.metona.cn/MetonaTeam/MetonaToast/raw/branch/master/dist/metona-toast.esm.js';
|
||||
</script>
|
||||
```
|
||||
|
||||
@@ -67,7 +67,7 @@ const MeToast = require('metona-toast');
|
||||
浏览器中 `window` 上会注册两个全局变量:`MeToast` 和 `Met`,两者完全等价,任选其一使用。
|
||||
|
||||
```javascript
|
||||
import MeToast from 'metona-toast';
|
||||
import MeToast from '@metona-team/metona-toast';
|
||||
|
||||
// 也可以使用 Met — 与 MeToast 完全等价
|
||||
Met.success('使用 Met 同样可用');
|
||||
@@ -195,7 +195,7 @@ MeToast.use('persistence'); // 配置持久化到 localStorage
|
||||
MeToast.use('accessibility'); // 屏幕阅读器朗读公告
|
||||
|
||||
// 自定义插件(通过 install 中注册 Toast 生命周期钩子)
|
||||
import MeToast, { Toast } from 'metona-toast';
|
||||
import MeToast, { Toast } from '@metona-team/metona-toast';
|
||||
|
||||
MeToast.use({
|
||||
name: 'my-plugin',
|
||||
|
||||
Reference in New Issue
Block a user