Skip to content

Commit d444629

Browse files
committed
feat: support names argument in API hide, get
1 parent b43f5bc commit d444629

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

dist/VueFinalModal.esm.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.

dist/VueFinalModal.esm.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.

dist/VueFinalModal.umd.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.

dist/VueFinalModal.umd.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.

lib/PluginCore.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ function createVfm(options) {
5050
break
5151
}
5252
},
53-
hide(name) {
54-
this.toggle(name, false)
53+
hide(...names) {
54+
this.toggle(names, false)
5555
},
5656
hideAll() {
5757
for (let i = this.openedModals.length - 1; i >= 0; i--) {
5858
this.openedModals[i].emit('update:modelValue', false)
5959
}
6060
},
6161
toggle(name, ...args) {
62-
const modals = this.get(name)
62+
const modals = Array.isArray(name) ? this.get(...name) : this.get(name)
6363
modals.forEach(modal => modal.toggle(...args))
6464
},
65-
get(name) {
66-
return this.modals.filter(modal => modal.props.name === name)
65+
get(...names) {
66+
return this.modals.filter(modal => names.includes(modal.props.name))
6767
},
6868
dynamicModals: shallowReactive([]),
6969
openedModals: [],

0 commit comments

Comments
 (0)