0👍
You could move the login inside your component by making use of 2 props, for example name
, which is a String
, and maritalStatus
, which is either a String
or Boolean
depending on your needs (the example assumes a Boolean for maritalStatus
). Then inside your component construct the message you want to display:
<label>
Position of {{element.name}} <span v-if="maritalStatus">Free</span><span v-else>Married</span>
</label>
You could also use string literals:
myAnnoyingProp: `Position of ${name} ${maritalStatus}`
- [Vuejs]-Which right way to organization vue.js components and Laravel backend
- [Vuejs]-Cannot access variable from named imports in vuejs
Source:stackexchange.com