[Vuejs]-How to add a property with Vue.JS

0๐Ÿ‘

Iโ€™m assuming that you have movie.title defined on your component data and you want that value to end up as value for uk-toggle.

In that case try this:

<button :uk-toggle= "'target:' + movie.title" type="button">

0๐Ÿ‘

uk toggle work like this

     <button class="uk-button uk-button-default" type="button" 
       uk-toggle="target: #toggle-usage">Toggle</button>
        <p id="toggle-usage">Hello</p>

https://getuikit.com/docs/toggle

So here in vueJs are you binding the message in movie.title ?

<button :uk-toggle= "target:#toggle-usage" type="button">
<p id="toggle-usage">Hello</p>

try this value is getting bind so you can easily convert to dynamic values

Leave a comment