vue.js - Vue values not recognized in template -
trying out vue first time , having problem values not being recognized in template though set when checking chrome vue debug tool.
i'm doing in wordpress context if matters, inline template. stripped down lot of non-important code in example below focus on loader. i'm setting loading value true , here i'm not changing anywhere. when loading page can see spinner briefly disappears. value of loading true when check debug tool. doing wrong?
javascript:
(function($) { var employeeslistingelement = document.getelementbyid('vue-employees-listing'); if ( employeeslistingelement ) { var employeeslisting = new vue({ el : employeeslistingelement, data() { return { employees: [], filter: '', errors: [], loading: true } } }); } })(jquery); html
<div id="vue-employees-listing"> <div v-if="employees.loading" class="ajax-loader"> <p>loading</p> </div> </div>
your template should be
<div v-if="loading" class="ajax-loader"> employees array.
Comments
Post a Comment