Skip to content

Commit

Permalink
added removeByName function
Browse files Browse the repository at this point in the history
  • Loading branch information
s4l1h committed Oct 17, 2018
1 parent e473587 commit 37c9edf
Show file tree
Hide file tree
Showing 20 changed files with 7,747 additions and 174 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
');
// Register vue component
Vue.component('vue-toastr',Toastr);
***Plugin** mode (work only vue 2.x)*
***Plugin** mode (work only vue 2.x)*

// import Toastr
import Toastr from 'vue-toastr';
Expand All @@ -55,7 +55,7 @@
this.$root.$refs.toastr.s("SUCCESS MESSAGE");
// use plugin
this.$toastr.e("ERRROR MESSAGE");
this.$toastr.s("SUCCESS MESSAGE");
this.$toastr.s("SUCCESS MESSAGE");

### without npm

Expand Down Expand Up @@ -134,13 +134,18 @@ this.$refs.toastr.i("this.$refs.toastr.i message", "Information");
```
this.$refs.toastr.removeByType("error"); // error, warning, success, info
```
#### Remove Toast Messages by Name.
```
this.$refs.toastr.removeByName("UniqueToastName");
```
#### New Toast Message with default options.
```
this.$refs.toastr.Add("Working on the default options");
```
#### New Toast Message with options.
```
this.$root.$refs.toastr.Add({
name: "UniqueToastName", // Toast Name now you can remove by name
title: "Easy Toast", // Toast Title
msg: "Hi", // Message
clickClose: false, // Click Close Disable
Expand All @@ -155,8 +160,9 @@ this.$root.$refs.toastr.Add({
## Doc # Options
```
{
name: "Name Of The Toast",
title: "Toast Title",
msg: "Toast Msg",
msg: "Toast Msg",
position: Toast position string can be 'toast-top-right', 'toast-bottom-right', 'toast-bottom-left', 'toast-top-left', 'toast-top-full-width', 'toast-bottom-full-width', 'toast-top-center', 'toast-bottom-center' ; default toast-top-right
type: Toast type can be : info,warning,error,success ; default success
timeout: Toast Timeout for auto close can be integer ; default 5000
Expand All @@ -174,7 +180,7 @@ this.$root.$refs.toastr.Add({
```

### Note:
Pls for more details and example:
Pls for more details and example:
https://github.com/s4l1h/vue-toastr/blob/master/demo.js


Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vue-toastr",
"main": "dist/vue-toastr.js",
"description": "Toastr for Vue.js",
"version": "2.0.13",
"version": "2.0.15",
"homepage": "https://github.com/s4l1h/vue-toastr",
"license": "MIT",
"ignore": [
Expand All @@ -11,4 +11,4 @@
"docs",
"package.json"
]
}
}
98 changes: 49 additions & 49 deletions build/webpack.config.combine.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
var webpack = require('webpack')
module.exports = {
entry: './src/main.js',
name: 'vueToastr',
output: {
path: './dist',
publicPath: '/dist/',
filename: 'vue-toastr.js',
library: ["vueToastr"],
libraryTarget: "umd"
},
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js'
}
},
module: {
loaders: [{
test: /\.less$/,
loader: "style!css!less",
}, {
test: /\.s[a|c]ss$/,
loader: 'style!css!sass'
}, {
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.html$/,
loader: "vue-html"
}, {
test: /\.js$/,
exclude: /node_modules|\/dist/,
loader: 'babel'
}]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime', 'lodash', 'add-module-exports']
entry: './src/main.js',
name: 'vueToastr',
output: {
path: './dist',
publicPath: '/dist/',
filename: 'vue-toastr.js',
library: ['vueToastr'],
libraryTarget: 'umd'
},
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js'
}
},
module: {
loaders: [{
test: /\.less$/,
loader: 'style!css!less'
}, {
test: /\.s[a|c]ss$/,
loader: 'style!css!sass'
}, {
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.html$/,
loader: 'vue-html'
}, {
test: /\.js$/,
exclude: /node_modules|\/dist/,
loader: 'babel'
}]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime', 'lodash', 'add-module-exports']
}
}
module.exports.output.filename = module.exports.output.filename.replace(/\.js$/, '.combine.min.js');
module.exports.output.filename = module.exports.output.filename.replace(/\.js$/, '.combine.min.js')
module.exports.plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
]
104 changes: 52 additions & 52 deletions build/webpack.config.min.js
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var webpack = require('webpack')
module.exports = {
entry: './src/main.js',
name: 'vueToastr',
output: {
path: './dist',
publicPath: '/dist/',
filename: 'vue-toastr.js',
library: ["vueToastr"],
libraryTarget: "umd"
},
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js'
}
},
module: {
loaders: [{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
}, {
test: /\.s[a|c]ss$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!sass-loader")

}, {
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.html$/,
loader: "vue-html"
}, {
test: /\.js$/,
exclude: /node_modules|\/dist/,
loader: 'babel'
}]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime', 'lodash', 'add-module-exports']
entry: './src/main.js',
name: 'vueToastr',
output: {
path: './dist',
publicPath: '/dist/',
filename: 'vue-toastr.js',
library: ['vueToastr'],
libraryTarget: 'umd'
},
resolve: {
alias: {
vue$: 'vue/dist/vue.esm.js'
}
},
module: {
loaders: [{
test: /\.less$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader')
}, {
test: /\.s[a|c]ss$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader')

}, {
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.html$/,
loader: 'vue-html'
}, {
test: /\.js$/,
exclude: /node_modules|\/dist/,
loader: 'babel'
}]
},
babel: {
presets: ['es2015'],
plugins: ['transform-runtime', 'lodash', 'add-module-exports']
}
}
module.exports.output.filename = module.exports.output.filename.replace(/\.js$/, '.min.js');
module.exports.output.filename = module.exports.output.filename.replace(/\.js$/, '.min.js')
module.exports.plugins = [
new ExtractTextPlugin(module.exports.output.filename.replace(/\.js$/, '.css')),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
new ExtractTextPlugin(module.exports.output.filename.replace(/\.js$/, '.css')),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
]
Loading

0 comments on commit 37c9edf

Please sign in to comment.