Genie Discord forum

Author AvatarFrozenCat
12/9/2022, 10:54:22 AM

I found @event macros, how it works?

Author Avatarabhimanyuaryan
12/12/2022, 2:59:00 PM

yes actually this is very recently(~2 weeks ago) contributed by Helmut. I need to check how this works. I'll get back to you.

Author Avatarabhimanyuaryan
12/12/2022, 4:26:05 PM

I'll try to document it. I don't understand completely how this works yet

What I think is uploader has uploaded event. Which basically triggers a method

@uploaded -> function(info)

https://quasar.dev/vue-components/uploader

Author Avatarabhimanyuaryan
12/12/2022, 4:26:36 PM

and this is trying to achieve that same functionality


julia> uploader("Upload files", url = "/upload" , autoupload = true, :multiple,
                   @on(:uploaded, :uploaded, "for (let f in event.files) { event.files[f].fname = event.files[f].name }")
               )
"<q-uploader url=\"/upload\" auto-upload multiple v-on:uploaded='function(event) { ;const preprocess = (event) => { for (let f in event.files) { event.files[f].fname = event.files[f].name }; return event };;    handle_event(preprocess(event), \"uploaded\");}'>Upload files</q-uploader>"
Author Avatarabhimanyuaryan
12/12/2022, 4:26:44 PM

v-on:uploader is basically @uploader

Author Avatarabhimanyuaryan
12/12/2022, 4:27:19 PM

@hhaensel correct me if wrong

Author Avatarabhimanyuaryan
12/12/2022, 4:33:11 PM

and on uploaded it reads check if file endswith regex csv and insert csv into df

and @onchange df it updates the table to render data