【发布时间】:2017-11-10 05:27:24
【问题描述】:
我想动态加载诸如recaptcha之类的脚本,因为我只想在Register.Vue / login.Vue组件内部加载
<script src="https://www.google.com/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer>
</script>
如果我将脚本标签放在我的 Vue 文件中,我会收到此错误:
- Templates should only be responsible for mapping the state to the UI. Avoid
placing tags with side-effects in your templates, such as <script>, as they will
not be parsed.
我该如何解决这个问题?
【问题讨论】:
标签: javascript vue.js vuejs2