Genie Discord forum

Author AvatarMordegai
8/7/2023, 9:57:56 AM

I'm trying to get a q-select component working but am running into a problem when I define the options.

As it is now, I either have the option of having a disfunctional q-select element with the following line:

    <q-select v-model="sim_model" options = ":sim_model_options"></q-select>

Or having nothing being displayed at all if I change the above line into:

    <q-select v-model="sim_model" :options = ":sim_model_options"></q-select>

What am I doing wrong????

The full source code can be found here:

I'm not using the ui.jl file

Everything worked fine until I added the lines containing "sim_model_options" in both the Julia and HTML code. I get no errors in the server output console, nor can I find any in the log file but I also get nothing to see in the web browser, except for the menu bar (screenshot attached).

I'm using Chrome on MacOS as a browser.

Any idea what is going on?

Author AvatarPere
8/11/2023, 9:55:58 AM

you need to expose the sim_model_options vector with @out. Also, the options must be a list of symbols. Check out the iris demo for an example

Note that, if you want to still initialize the sim_model variable to sim_model_options1, you'll have to define first the options vector and then expose it with @out like in the example above. @out will create a copy of sim_model_options and send it to the UI.

Author AvatarMordegai
8/15/2023, 9:01:50 AM

I tried the following: but that doesn't seem to work. I'm guessing I'm doing something wrong with the syntax? I'm not getting an error either, just a blank screen.

Author AvatarPere
8/15/2023, 9:14:49 AM

Anything passed to v-ifis assumed to be a Javascript expression. Thus, you don't need null to interpolate variable values

Author AvatarMordegai
8/15/2023, 4:18:54 PM

That works! Pity Javascript starts their arrays at index 0 while Julia starts at index 1 ๐Ÿ˜‰

Author AvatarMordegai
8/15/2023, 4:19:16 PM

But not a huge problem of course