Skip to content

Commit 435b887

Browse files
Lloyd@MNetLloyd@MNet
authored andcommitted
listening to modal events
1 parent fd8f5e4 commit 435b887

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

TestApp/Sample.Modal.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ <h2>Live Example</h2>
4242
<h3>customized header</h3>
4343
</div>
4444
<div class="modalbody">
45-
<h3>customized body</h3>
45+
<p>Name <input type="text" /></p>
46+
<p>Age <input type="text" /></p>
47+
<p>Info <input type="text" /></p>
4648
</div>
4749
</modal>
4850
</div>

TestApp/ScriptsLocal/components/Modal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ <h4 class="modal-title" id="myModalLabel">Modal title</h4>
99
</div>
1010
<div class="modal-body">
1111
<content select=".modalbody">
12-
<div class="modal-body">
12+
<div>
1313
default body
1414
</div>
1515
</content>
1616
</div>
1717
<div class="modal-footer">
18-
<button type="button" class="btn btn-default" v-on="click: show = false">Close</button>
18+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1919
<button type="button" class="btn btn-primary">Save changes</button>
2020
</div>
2121
</div>

TestApp/ScriptsLocal/components/Modal.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TestApp/ScriptsLocal/components/Modal.js.map

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

TestApp/ScriptsLocal/components/Modal.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
}
1212
},
1313
ready: function () {
14+
$(this.$el).on('shown.bs.modal', () => this.show = true);
15+
$(this.$el).on('hidden.bs.modal', () => this.show = false);
1416
this.showModal(this.show);
1517
},
1618
methods: {

0 commit comments

Comments
 (0)