如何将PHP与组成API VUEJS 3使用
来自PHP/jQuery背景,您可以在同一文件中使用PHP和jQuery代码,例如某些名为index.php
的文件:
<?php
echo "hey";
?>
<script>
$("#someId").html("abc")
</script>
如何使用vuejs v3 您可以在其中访问.vue
文件内的访问PHP变量/会话等。或者您的SFC文件也包括PHP代码?
我知道您可以通过在index.php文件中加入脚本标签的VUE框架来做到这一点,但据我所知,您无法使用此方法使用构图API。
我可能缺少一些基本的东西,但我找不到答案。
Coming from a PHP/jQuery background, where you can have PHP and jQuery code in the same file, for example some file called index.php
:
<?php
echo "hey";
?>
<script>
$("#someId").html("abc")
</script>
How can you do something similar with the Composition API in VueJS v3 where you can access access your PHP variables/sessions etc. inside of a .vue
file or have your SFC files to include PHP code as well?
I know you can do this by including the vue framework with script tags inside of your index.php file but as far as I'm aware you can't use the Composition API with this method.
I'm probably missing something basic but I haven't been able to find the answer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论