2017-04-24 56 views
0

我在一个小型项目上工作,并使用VUEJS和PHP将其支持到Wordpress上。混合PHP值和VueJS值

<div v-if="ent.Account === 'username' " v-for="ent in leaders"> 
hey there {{ ent.Name }} welcome back! 
</div> 

林想要的 “用户名” 为等于在用户登录从WordPress的

<?php $current_user->user_login ?> 
+2

试'ent.Account ===“< ?php echo $ current_user-> user_login?>'' – thanksd

回答

0

当前尝试这种情况:

<div v-if="ent.Account === '<?php $current_user->user_login ?>' " v-for="ent in leaders"> 
hey there {{ ent.Name }} welcome back! 
</div>