wave-ui 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wave-ui",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
|
|
5
5
|
"author": "Antoni Andre <antoniandre.web@gmail.com>",
|
|
6
6
|
"homepage": "https://antoniandre.github.io/wave-ui",
|
|
@@ -272,16 +272,19 @@ export default {
|
|
|
272
272
|
if (typeof index === 'string') index = ~~index
|
|
273
273
|
else if (isNaN(index) || index < 0) index = 0
|
|
274
274
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this
|
|
281
|
-
|
|
282
|
-
this.activeTabEl
|
|
283
|
-
|
|
284
|
-
|
|
275
|
+
// Only open the tab if it is found.
|
|
276
|
+
if (this.tabs[index]?._uid) {
|
|
277
|
+
this.openTab(this.tabs[index]?._uid)
|
|
278
|
+
|
|
279
|
+
// Scroll the new active tab item title into view if needed.
|
|
280
|
+
this.$nextTick(() => {
|
|
281
|
+
const ref = this.$refs['tabs-bar']
|
|
282
|
+
this.activeTabEl = ref && ref.querySelector(`.w-tabs__bar-item:nth-child(${index + 1})`)
|
|
283
|
+
if (this.activeTabEl) {
|
|
284
|
+
this.activeTabEl.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' })
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
}
|
|
285
288
|
},
|
|
286
289
|
|
|
287
290
|
// Return the original item (so there is no `_index`, etc.).
|
|
@@ -295,7 +298,7 @@ export default {
|
|
|
295
298
|
const items = typeof this.items === 'number' ? Array(this.items).fill().map(Object) : this.items
|
|
296
299
|
items.forEach(this.addTab)
|
|
297
300
|
|
|
298
|
-
this.updateActiveTab(this.modelValue)
|
|
301
|
+
if (this.modelValue ?? false) this.updateActiveTab(this.modelValue)
|
|
299
302
|
|
|
300
303
|
this.$nextTick(() => {
|
|
301
304
|
this.updateSlider()
|