[Vuejs]-Using double curly Vue.js braces inside php string param

0👍

Techincally you can’t.

But if what Path::o365() does is to convert a resource name into a url, you can make a workaround like this:

<img :src="`<?= Path::o365('${task.title}' . '.svg'); ?>'`" />

This will eventually resolves into something like this:

<img :src="`https://example.com/images/${task.title}.svg`" />

Which is actually a legit javascript string literal and also refers to the variable task.title

Leave a comment