cscan / vue3-excel-editor

Vue3 plugin for displaying and editing the array-of-object in Excel style.
MIT License
231 stars 51 forks source link

initStyle of column doesn't work properly - VUE 3 #39

Closed ganevaleks closed 4 months ago

ganevaleks commented 5 months ago

Screenshot 2023-12-04 at 18 16 41

My code

function cellStyle(content) { if(content !== null && content === "BREAK45") { objectColor.color = "red"; return content; } else { objectColor.color = "black"; return content; } }

All columns of row 5 that have the string "BREAK45" should be colored red, but they're not.

Any suggestions?

cscan commented 5 months ago

you should return the cell style in object, e.g. {color:red ....Sent from my phone-------- Original message --------From: ganevaleks @.>Date: 2023年12月5日週二 00:23To: cscan/vue3-excel-editor @.>Cc: Subscribed @.***>Subject: [cscan/vue3-excel-editor] initStyle of column doesn't work properly - VUE 3 (Issue #39) Screenshot.2023-12-04.at.18.16.41.png (view on web) My code function cellStyle(content) { if(content !== null && content === "BREAK45") { objectColor.color = "red"; return content; } else { objectColor.color = "black"; return content; } } All columns of row 5 that have the string "BREAK45" should be colored red, but they're not. Any suggestions?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

ganevaleks commented 5 months ago

yes, that's the way i'm returning it. But first elelement is not colored red and first two of row 6 are colored, but they don't have to be.

Screenshot 2023-12-05 at 9 23 51

cscan commented 4 months ago

cellStyle has other arguments for you to identify which row is it.