From 2874403c8dff00337b2c4357904416a167fcd939 Mon Sep 17 00:00:00 2001 From: TANG <40519806@qq.com> Date: Wed, 22 Apr 2020 22:58:01 +0800 Subject: [PATCH] Fixed extra-props error --- dist/index.js | 20 +++++++++++--------- package-lock.json | 4 ++-- package.json | 2 +- src/item.js | 12 ++++++------ 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3eb53d2..613574f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,5 +1,5 @@ /*! - * vue-virtual-scroll-list v2.1.0 + * vue-virtual-scroll-list v2.1.1 * open source under the MIT license * https://github.com/tangbc/vue-virtual-scroll-list#readme */ @@ -534,14 +534,15 @@ mixins: [Wrapper], props: ItemProps, render: function render(h) { - var component = this.component, - _this$itemProps = this.itemProps, - itemProps = _this$itemProps === void 0 ? {} : _this$itemProps; - itemProps.source = this.source; - return h(this.tag, { + var tag = this.tag, + component = this.component, + _this$extraProps = this.extraProps, + extraProps = _this$extraProps === void 0 ? {} : _this$extraProps; + extraProps.source = this.source; + return h(tag, { role: 'item' }, [h(component, { - props: itemProps + props: extraProps })]); } }); // wrapping for slot @@ -550,8 +551,9 @@ mixins: [Wrapper], props: SlotProps, render: function render(h) { - var uniqueKey = this.uniqueKey; - return h(this.tag, { + var tag = this.tag, + uniqueKey = this.uniqueKey; + return h(tag, { attrs: { role: uniqueKey } diff --git a/package-lock.json b/package-lock.json index 8257b6d..597b52f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-virtual-scroll-list", - "version": "2.0.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2190,7 +2190,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" diff --git a/package.json b/package.json index 0344c29..4f5b565 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-virtual-scroll-list", - "version": "2.1.0", + "version": "2.1.1", "description": "A vue component support big amount data list with high scroll performance.", "main": "dist/index.js", "files": [ diff --git a/src/item.js b/src/item.js index 68dcc50..b9bee08 100644 --- a/src/item.js +++ b/src/item.js @@ -55,13 +55,13 @@ export const Item = Vue.component('virtual-list-item', { props: ItemProps, render (h) { - const { component, itemProps = {} } = this - itemProps.source = this.source + const { tag, component, extraProps = {} } = this + extraProps.source = this.source - return h(this.tag, { + return h(tag, { role: 'item' }, [h(component, { - props: itemProps + props: extraProps })]) } }) @@ -73,9 +73,9 @@ export const Slot = Vue.component('virtual-list-slot', { props: SlotProps, render (h) { - const { uniqueKey } = this + const { tag, uniqueKey } = this - return h(this.tag, { + return h(tag, { attrs: { role: uniqueKey }