Skip to content

Commit

Permalink
docs: ✏️ Add example application
Browse files Browse the repository at this point in the history
  • Loading branch information
vctrtvfrrr committed Mar 3, 2021
1 parent 990c3f8 commit 7d662f8
Show file tree
Hide file tree
Showing 17 changed files with 27,894 additions and 18 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Installation

```bash
npm install @meforma/vue-toaster
npm install @incuca/vue3-toaster
```

## Usage
Expand Down Expand Up @@ -44,19 +44,19 @@ toast.show(message, { ...options });

The API methods accepts these options:

| Attribute | Type | Default | Description |
| :------------ | :--------------: | :------------: | :---------------------------------------------------------------------------- |
| message | String | -- | Message text/html (required) |
| type | String | `default` | `success`, `info`, `warning`, `error` or `default` |
| position | String | `bottom-right` | `top`, `bottom`, `top-right`, `bottom-right`,`top-left` or `bottom-left` |
| duration | Number/Boolean | `4000` | Visibility duration in milliseconds or `false` that disables duration |
| dismissible | Boolean | `true` | Allow user close by clicking |
| onClick | Function | -- | Do something when user clicks |
| onClose | Function | -- | Do something after toast gets dismissed |
| queue | Boolean | `false` | Wait for existing to close before showing new |
| maxToasts | Number/Boolean | `false` | Defines the max of toasts showed in simultaneous |
| pauseOnHover | Boolean | `true` | Pause the timer when mouse hover a toast |
| useDefaultCss | Boolean | `true` | Use default css styles |
| Attribute | Type | Default | Description |
| :------------ | :------------: | :------------: | :----------------------------------------------------------------------- |
| message | String | -- | Message text/html (required) |
| type | String | `default` | `success`, `info`, `warning`, `error` or `default` |
| position | String | `bottom-right` | `top`, `bottom`, `top-right`, `bottom-right`,`top-left` or `bottom-left` |
| duration | Number/Boolean | `4000` | Visibility duration in milliseconds or `false` that disables duration |
| dismissible | Boolean | `true` | Allow user close by clicking |
| onClick | Function | -- | Do something when user clicks |
| onClose | Function | -- | Do something after toast gets dismissed |
| queue | Boolean | `false` | Wait for existing to close before showing new |
| maxToasts | Number/Boolean | `false` | Defines the max of toasts showed in simultaneous |
| pauseOnHover | Boolean | `true` | Pause the timer when mouse hover a toast |
| useDefaultCss | Boolean | `true` | Use default css styles |

## License

Expand Down
3 changes: 3 additions & 0 deletions example/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
14 changes: 14 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint"
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
}
};
23 changes: 23 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# example

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
3 changes: 3 additions & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};

0 comments on commit 7d662f8

Please sign in to comment.