Skip to content

Commit

Permalink
release(notification): v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed May 28, 2024
1 parent f62df49 commit c766f71
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
},
"notification": {
"icon": true,
"version": "0.3.0",
"version": "0.3.1",
"style": true,
"test": true,
"install": false,
Expand Down
12 changes: 6 additions & 6 deletions src/notification/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import find from 'licia/find'
import h from 'licia/h'
import Component, { IComponentOptions } from '../share/Component'
import { exportCjs } from '../share/util'
import isUndef from 'licia/isUndef'

/** IPosition */
export interface IPosition {
Expand All @@ -16,7 +17,7 @@ export interface IPosition {
/** INotifyOptions */
export interface INotifyOptions {
/** Notification duration. */
duration: number
duration?: number
/** Notification icon. */
icon?: string
}
Expand Down Expand Up @@ -68,12 +69,11 @@ export default class Notification extends Component<IOptions> {
this.initTpl()
}
/** Show notification. */
notify(
content: string,
options: INotifyOptions = {
duration: this.options.duration,
notify(content: string, options: INotifyOptions = {}) {
if (isUndef(options.duration)) {
options.duration = this.options.duration
}
) {

const notification = new NotificationItem(this, content, {
icon: options.icon || 'none',
})
Expand Down
2 changes: 1 addition & 1 deletion src/notification/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notification",
"version": "0.3.0",
"version": "0.3.1",
"description": "Show notifications",
"luna": {
"icon": true
Expand Down

0 comments on commit c766f71

Please sign in to comment.