我有一个vue js组件:
<template>
<div>
hello world
</div>
</template>
<script>
export default {
name: 'mycomp',
data: function () {
console.error("window.google_recaptcha_public_key", window.google_recaptcha_public_key);
return {
}
},
mounted() {
let app = this;
console.error("window.google_recaptcha_public_key2", window.google_recaptcha_public_key);
},
}
</script>
<style scoped lang="scss">
</style>
返回:
window.google_recaptcha_public_key undefined
window.google_recaptcha_public_key2 undefined
我在哪里可以留下无痛和快乐的全球配置?
注意,这个配置存在于我的laravel后端.所以我不会将所有值从后端复制粘贴到前端