Skip to content

Instantly share code, notes, and snippets.

@darnocer
Last active December 22, 2020 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darnocer/4c53ecdbde6ecfb679829688afb3e96f to your computer and use it in GitHub Desktop.
Save darnocer/4c53ecdbde6ecfb679829688afb3e96f to your computer and use it in GitHub Desktop.
Concatenating a string with data-binding in Vue.js

Concatenating Data-Binding with Strings in Vue

Use single-quotes for the string within the double quotes like:

:property="'string' + data"

Example: :class="'skill-level--' + item.level"

Output: class-="skill-level--100"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment