-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4fd0270
Showing
22 changed files
with
689 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
docs | ||
bower.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "vue-toastr", | ||
"main": "dist/vue-toastr.js", | ||
"description": "Toastr for Vue.js", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/s4l1h/vue-toastr", | ||
"license": "MIT", | ||
"ignore": [ | ||
".*", | ||
"build", | ||
"docs", | ||
"package.json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var vue = require('vue-loader') | ||
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" | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.less$/, | ||
loader: "style!css!less", | ||
}, { | ||
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.plugins = [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: '"production"' | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: false, | ||
compress: { | ||
warnings: false | ||
} | ||
}), | ||
new webpack.optimize.OccurenceOrderPlugin() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var vue = require('vue-loader') | ||
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" | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.less$/, | ||
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-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.plugins = [ | ||
new ExtractTextPlugin(module.exports.output.filename.replace(/\.js$/, '.css')), | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: '"production"' | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap:true, | ||
compress: { | ||
warnings: false | ||
} | ||
}), | ||
new webpack.optimize.OccurenceOrderPlugin() | ||
] | ||
module.exports.devtool = '#source-map' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var vue = require('vue-loader') | ||
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" | ||
}, | ||
module: { | ||
loaders: [{ | ||
test: /\.less$/, | ||
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-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.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() | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'use strict'; | ||
new Vue({ | ||
el: '#app', | ||
data: function data() { | ||
return {}; | ||
}, | ||
components: { | ||
'vue-toastr': window.vueToastr | ||
}, | ||
methods: { | ||
add: function() { | ||
//console.log(this.$refs.toastr); | ||
// if you send String default setting working. | ||
this.$refs.toastr.Add("Working With Default Options,closed 5 sec."); | ||
// Add another Toast | ||
var VooAaa = this.$refs.toastr.Add({ | ||
title: 'Hi Click And See : ', // + (Math.random() * 10).toString(), | ||
msg: '<p id="test">AA</p><br>This timeout 5 sec.. but manuel closed 2 sec.', // + (Math.random() * 10).toString(), | ||
type: 'warning', | ||
position: 'toast-top-left', | ||
timeout: 5000, | ||
clickClose: false, | ||
onClosed: function() { | ||
alert("onClosed"); | ||
}, | ||
onCreated: function() { | ||
// get from test id from toast component. | ||
// if component not created you cant access this. | ||
alert("onCreated " + document.getElementById("test").innerHTML); | ||
}, | ||
onClicked: function() { | ||
alert("onClicked"); | ||
} | ||
}); | ||
//console.log(VooAaa); | ||
// You can close manuel this. | ||
setTimeout(function() { | ||
this.$refs.toastr.Close(VooAaa); | ||
}.bind(this), 2000); | ||
//this.$refs.toastr.close(VooAaa); | ||
|
||
|
||
// You Can Change Default Toast Type | ||
this.$refs.toastr.defaultTimeout = 3000; // default timeout : 5000 | ||
// You Can Change Default Toast Type | ||
this.$refs.toastr.defaultType = "error"; // default type : success | ||
// You Can Change Default Position | ||
this.$refs.toastr.defaultPosition = "toast-bottom-left" // default position: toast-top-right | ||
this.$refs.toastr.Add("Default Type Position and timeout is Changed, closed 3 sec."); | ||
} | ||
} | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.