0👍
Try by using parent_id
in data for adding -
as:
<option v-for="category in categories" value="category.id"><span v-if="category.parent_id">{{getDash(parent_id)}}</span>{{category.name}}</option>
new Vue({
...
computed: {
getDash: function (parentId) {
let string = '';
for(let i = 0; i < parentId; i++) {
string += '-'
}
return string;
}
}
...
})
- [Vuejs]-Cannot render Vue-js in template
- [Vuejs]-How to configure symfony to work with Vue.js in HTML5 History mode
Source:stackexchange.com