New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(b-table, b-table-lite): new tbody-tr-attr
prop for arbitrary row attributes (closes #1864)
#4481
Conversation
Adds a trAttr attribute to b-table, which can either be an object or a function An object is added straight to the attributes of each row A function gets passed each item and is expected to return an object
Codecov Report
@@ Coverage Diff @@
## dev #4481 +/- ##
==========================================
+ Coverage 99.91% 99.91% +<.01%
==========================================
Files 247 247
Lines 4851 4855 +4
Branches 1359 1363 +4
==========================================
+ Hits 4847 4851 +4
Misses 3 3
Partials 1 1
Continue to review full report at Codecov.
|
tr-attr
prop for arbitrary row attributes
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I've tweaked the PR to make the prop |
tr-attr
prop for arbitrary row attributestbody-tr-attr
prop for arbitrary row attributes
tbody-tr-attr
prop for arbitrary row attributestbody-tr-attr
prop for arbitrary row attributes (closes #1864)
@CyBot can you take another look to make sure I don't have any other typos creeping in? And thanks for the PR, this has been on the back-burner for a while. |
Looking good |
Can anyone give example to use this props HTML
Vue
|
@Ragavendhran-N the value returned by the function attributes must be an object: methods: {
setMyAttribute(){
return {
'data-foo': 'bar',
title: 'Some title'
}
}
} Note that you cannot bind handler methods via attributes in Vue. |
Adds new prop
tbody-tr-attr
tob-table
andb-table-lite
, which can either be an object or a functionAn object is added straight to the attributes of each row
A function gets passed each item, and row type, and is expected to return an object
The function version has the same calling signature as the
tbody-tr-class
prop.Describe the PR
Allows to add custom attributes to individual table rows, either directly as name: value object attributes, or via a function which receives the row item and returns such an object.
Closes #1864
PR checklist
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
dev
branch, not themaster
branch[...] (fixes #xxx[,#xxx])
, where "xxx" is the issue number)fix(alert): not alerting during SSR render
,docs(badge): update pill examples
,chore(docs): fix typo in README
, etc). This is very important, as theCHANGELOG
is generated from these messages.If new features/enhancement/fixes are added or changed:
package.json
for slot and event changes)If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes: