Comments (5)
@bolerio
I add new feature to support v-slot, maybe can solve your problem. check #15 please.
And I will be close this issue. If you any question, reopen.
from vue3-table-lite.
Hi, @bolerio
Sorry, not support template yet.
But if you want to use "vue-router", you can code like this. It's work.
table column:
{
label: "Name",
field: "name",
display: function (row) {
return (
'<a href="#" data-link="' + row.link + '" class="is-rows-el route-link">' + row.name + '</a>'
);
},
},
finished event:
const tableLoadingFinish = (elements) => {
table.isLoading = false;
Array.prototype.forEach.call(elements, function (element) {
if (element.classList.contains("route-link")) {
element.addEventListener("click", function () {
// router is your vue-router object
router.push(this.dataset.link)
});
}
});
};
from vue3-table-lite.
Hi, I just made a very simple table where you can use slots.
Maybe someone can this combine with vue3-table-lite.
from vue3-table-lite.
@linmasahiro How to pass methods inside column display ??? its not working
display: function (row) {
return (
'<span class="pointer" @click="editThis(row)" class="t-color">Edit | Delete'
);
},
from vue3-table-lite.
@linmasahiro How to pass methods inside column display ??? its not working
display: function (row) {
return (
'<span class="pointer" @click="editThis(row)" class="t-color">Edit | Delete'
);
},
Hi, @WordpressArtist , Try change row display func to
// Point: Added 「is-rows-el」and 「edit-btn」class.
// Important: If you need action any tag. 「is-rows-el」is require.
display: function (row) {
return '<span class="is-rows-el edit-btn pointer t-color" data-row="' + JSON.stringify(row).replace(/"/g, '"') + '">Edit | Delete</span>';
},
and Fix your 「tableLoadingFinish」event to like this
const tableLoadingFinish = (elements) => {
table.isLoading = false;
Array.prototype.forEach.call(elements, function (element) {
if (element.classList.contains("edit-btn")) {
element.addEventListener("click", function () {
editThis(JSON.parse(this.dataset.row));
});
}
});
};
This is work, but I don't recommend. I always pass require value only. Like this
display: function (row) {
return '<span class="is-rows-el edit-btn pointer t-color" data-id="' + row.id + '">Edit | Delete</span>';
},
const tableLoadingFinish = (elements) => {
table.isLoading = false;
Array.prototype.forEach.call(elements, function (element) {
if (element.classList.contains("edit-btn")) {
element.addEventListener("click", function () {
editThis(this.dataset.id);
});
}
});
};
Hope help you.
from vue3-table-lite.
Related Issues (20)
- selected rows are not updated immediately after rows are updated HOT 5
- Checked rows always return undefined after paging (Only「checked-return-type」 is 'row') HOT 1
- Unchecking rows(s) HOT 2
- Multiple fixed columns HOT 3
- Header's first column is always fixed on horizontal scrolling
- Unable to get table width to be responsive and fixed first column in table header not fixed HOT 18
- Sortable function doesn't work with grouping key HOT 2
- Links under slot mode stopped working in 1.3.2 HOT 1
- checking rows doesn't work in 1.3.2 and 1.3.3 HOT 1
- Return duplicated value on「return-checked-rows」event HOT 1
- click event not handled in tableLoadingFinish function HOT 2
- Static mode pagination not working as expected HOT 3
- Is it possible to add 'return clearChecked' if 'hasCheckbox'?
- Is it possible to add 'return clearChecked' if 'hasCheckbox'? HOT 6
- Bug when dynamically showing checkboxes HOT 1
- Grouping with toggle like a treeview inside table ? HOT 4
- [OTHERS] Call a Function inside of display property for a button HOT 12
- Unchecking row returns old value HOT 5
- Examples not compatible with latest version of vue3 and node18 HOT 1
- Allow HTML in header HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue3-table-lite.