Skip to content

Commit 9b93ef0

Browse files
committed
add key to returned data to indicate if closed by esc or bg click
1 parent b537607 commit 9b93ef0

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

build/webpack.base.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const options = require('./options');
44
const autoprefixer = require('autoprefixer');
55
const VueLoaderPlugin = require('vue-loader/lib/plugin');
6+
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
67

78
module.exports = {
89
resolve: {
@@ -44,6 +45,7 @@ module.exports = {
4445
]
4546
},
4647
plugins: [
47-
new VueLoaderPlugin(),
48+
new VueLoaderPlugin()
49+
// new BundleAnalyzerPlugin()
4850
]
4951
};

dist/vue2-slideout-panel.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-src/components/Home/template.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h2 class="project-tagline">
1515
<a href="https://github.com/officert/vue-slideout-panel/tarball/master" class="btn">Download .tar.gz</a>
1616
</div>
1717
<div class="demo-btn">
18-
<button class="btn btn-xl" v-on:click.prevent="showPanel3">
18+
<button class="btn btn-xl" @click.prevent="showPanel3">
1919
Demo
2020
</button>
2121
</div>
@@ -71,7 +71,7 @@ <h2>Examples</h2>
7171
<input class="form-control" v-model="example1Form.name" />
7272
</div>
7373
</form>
74-
<button v-on:click.prevent="showPanel1">
74+
<button @click.prevent="showPanel1">
7575
Show Panel
7676
</button>
7777
<div class="result">
@@ -87,7 +87,7 @@ <h2>Examples</h2>
8787
<input class="form-control" v-model="example1Form.name" />
8888
</div>
8989
</form>
90-
<button v-on:click.prevent="showPanel2">
90+
<button @click.prevent="showPanel2">
9191
Show Panel
9292
</button>
9393
</div>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"vue-style-loader": "^4.1.2",
6565
"vue-template-compiler": "^2.5.22",
6666
"webpack": "^4.28.4",
67+
"webpack-bundle-analyzer": "^3.3.2",
6768
"webpack-cli": "^3.2.1",
6869
"webpack-dev-server": "^3.1.14",
6970
"webpack-merge": "^4.2.1",

src/components/SlideoutPanel/index.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,15 @@ const vm = {
171171
172172
if (currentPanel.disableBgClick) return;
173173
174-
this.closeCurrentPanel();
174+
this.closeCurrentPanel({
175+
closedBy: 'bg'
176+
});
175177
},
176178
onEscapeKeypress(e) {
177179
if (e.keyCode === 27) {
178-
this.closeCurrentPanel();
180+
this.closeCurrentPanel({
181+
closedBy: 'esc'
182+
});
179183
}
180184
}
181185
},

0 commit comments

Comments
 (0)