[datatables vue]v-show does not work in slot templates

[datatables vue]v-show does not work in slot templates

serisu627serisu627 Posts: 5Questions: 1Answers: 0

This issue has been mentioned in the project's GitHub issues section, and I would like to inquire about it here.

https://github.com/DataTables/Vue/issues/32

i use Stackbltiz to create a running example

https://stackblitz.com/edit/vitejs-vite-5madia3d?file=src%2Fcomponents%2Fdatatbles.vue

Can you help me solve this problem?

thank you!!

Replies

  • allanallan Posts: 65,397Questions: 1Answers: 10,858 Site admin

    Thank you for the test case! The problem here is that DataTables doesn't "see" the change in the external variable so it doesn't redraw with the updated information. It does look for changes in the source data for the table, and if you change the data at the same time as isCheck then it will update as expected:

        OnTestEvent(e) {
          this.isCheck = !this.isCheck;
          this.tableData[0].causeText = this.tableData[0].causeText + ' ';
        },
    

    Updated test case.

    I'm wondering if I should provide a way to give the component variables to watch (i.e. isCheck in this case). It would of course be better not to need that at all - however, I suspect due to the DOM control DataTables has, something will be needed. I'll look into it further.

    Allan

  • serisu627serisu627 Posts: 5Questions: 1Answers: 0

    Hello allan

    Thank you so much for your answer and help.
    I will proceed based on the method you provided for now.

    It would be great if this question could be updated in the future!

Sign In or Register to comment.