Skip to content

安装

v0.3.11 · Latest stable

SoDialog 核心包没有运行时必需依赖。安装库后,业务代码显式导入 ESM API 与样式子路径。

bash
npm install sodialog
pnpm add sodialog
yarn add sodialog
bun add sodialog

ESM 导入

ts
import { openModal, pushMessage } from 'sodialog'
import 'sodialog/style.css'

openModal({
  title: 'Hello',
  content: '<p>Your dialog is ready.</p>',
})

pushMessage('success', '保存成功')

TypeScript

类型入口由 npm 包的 types 字段提供:dist/types/lib.d.ts。常用类型可以直接按需导入:

ts
import type { SoDialogModalOptions, SoToastOptions } from 'sodialog'

下一步

Released under the MIT License.