Skip to content

Commit c15487f

Browse files
committed
Add example project #10
1 parent a480923 commit c15487f

File tree

17 files changed

+9376
-5
lines changed

17 files changed

+9376
-5
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
example/

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ createApp(App).use(Toaster).mount('#app')
2323
## Usage
2424
```js
2525
// this.$toast.show(message, {/* options */});
26-
this.$toast.show('You did it!');
27-
this.$toast.success('You did it!');
28-
this.$toast.error('You did it!');
29-
this.$toast.warning('You did it!');
30-
this.$toast.info('You did it!');
26+
this.$toast.show(`Hey! I'm here`);
27+
this.$toast.success(`Hey! I'm here`);
28+
this.$toast.error(`Hey! I'm here`);
29+
this.$toast.warning(`Hey! I'm here`);
30+
this.$toast.info(`Hey! I'm here`);
3131

3232
// Close all opened toast after 3000ms
3333
setTimeout(this.$toast.clear, 3000)
@@ -90,6 +90,14 @@ this.$toast.success('Order placed.', {
9090
})
9191
```
9292

93+
## How to execute example
94+
95+
Clone the project and run:
96+
97+
```
98+
cd example; yarn install; yarn serve
99+
```
100+
93101
## Based on
94102
* [vue-toast-notification](https://github.com/ankurk91/vue-toast-notification) plugin
95103

example/.eslintignore

Whitespace-only changes.

example/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
pnpm-debug.log*
15+
16+
# Editor directories and files
17+
.idea
18+
.vscode
19+
*.suo
20+
*.ntvs*
21+
*.njsproj
22+
*.sln
23+
*.sw?

example/.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "always",
4+
"singleQuote": true,
5+
"trailingComma": "none"
6+
}

example/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# example
2+
3+
## Project setup
4+
```
5+
yarn install
6+
```
7+
8+
### Compiles and hot-reloads for development
9+
```
10+
yarn serve
11+
```
12+
13+
### Compiles and minifies for production
14+
```
15+
yarn build
16+
```
17+
18+
### Lints and fixes files
19+
```
20+
yarn lint
21+
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

example/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

example/package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "example",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"@meforma/vue-toaster": "^1.0.3",
12+
"core-js": "^3.6.5",
13+
"vue": "^3.0.0"
14+
},
15+
"devDependencies": {
16+
"@vue/cli-plugin-babel": "~4.5.0",
17+
"@vue/cli-plugin-eslint": "~4.5.0",
18+
"@vue/cli-service": "~4.5.0",
19+
"@vue/compiler-sfc": "^3.0.0",
20+
"babel-eslint": "^10.1.0",
21+
"eslint": "^6.7.2",
22+
"eslint-config-prettier": "^6.13.0",
23+
"eslint-plugin-prettier": "^3.1.4",
24+
"eslint-plugin-vue": "^7.0.0-0",
25+
"prettier": "^2.1.2",
26+
"stylus": "^0.54.8",
27+
"stylus-loader": "^3.0.2",
28+
"vue-loader": "^15.9.3"
29+
},
30+
"eslintConfig": {
31+
"root": true,
32+
"env": {
33+
"browser": true,
34+
"node": true
35+
},
36+
"extends": [
37+
"plugin:vue/vue3-essential",
38+
"eslint:recommended",
39+
"plugin:prettier/recommended"
40+
],
41+
"plugins": [
42+
"prettier"
43+
],
44+
"parserOptions": {
45+
"parser": "babel-eslint"
46+
},
47+
"rules": {
48+
"prettier/prettier": "error",
49+
"nuxt/no-cjs-in-config": "off",
50+
"no-console": 0,
51+
"vue/no-v-html": 0,
52+
"comma-dangle": 0
53+
}
54+
},
55+
"browserslist": [
56+
"> 1%",
57+
"last 2 versions",
58+
"not dead"
59+
]
60+
}

example/public/favicon.ico

4.19 KB
Binary file not shown.

example/public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)