Skip to content

Commit d318884

Browse files
Merge pull request #583 from SortableJS/componentData-attrs
Component data attrs
2 parents baa9362 + 8479d2e commit d318884

File tree

4 files changed

+81
-67
lines changed

4 files changed

+81
-67
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ Default: `null`<br>
269269
This props is used to pass additional information to child component declared by [tag props](#tag).<br>
270270
Value:
271271
* `props`: props to be passed to the child component
272+
* `attrs`: attrs to be passed to the child component
272273
* `on`: events to be subscribe in the child component
273274
274275
Example (using [element UI library](http://element.eleme.io/#/en-US)):
@@ -293,6 +294,9 @@ methods: {
293294
change: this.handleChange,
294295
input: this.inputChanged
295296
},
297+
attrs:{
298+
wrap: true
299+
},
296300
props: {
297301
value: this.activeNames
298302
}

package-lock.json

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

src/vuedraggable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ const draggableComponent = {
169169
update("attrs", attrs);
170170

171171
if (this.componentData) {
172-
const { on, props } = this.componentData;
172+
const { on, props, attrs } = this.componentData;
173173
update("on", on);
174174
update("props", props);
175+
Object.assign(attributes.attrs, attrs);
175176
}
176177
return h(this.getTag(), attributes, children);
177178
},

0 commit comments

Comments
 (0)