refactor: move spa to frontend folder
This commit is contained in:
18
module/oc_telegram_shop/upload/admin/view/integration.js
Executable file
18
module/oc_telegram_shop/upload/admin/view/integration.js
Executable file
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
function injectVueScript() {
|
||||
const script = document.createElement('script');
|
||||
script.type = 'module';
|
||||
//if (window.vueIntegration && window.vueIntegration.developmentEnv) {
|
||||
script.src = 'http://localhost:3000/src/main.js';
|
||||
//} else {
|
||||
// script.src = '/path/to/built/main.js';
|
||||
//}
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', injectVueScript);
|
||||
} else { // Документ уже загружен
|
||||
injectVueScript();
|
||||
}
|
||||
})();
|
||||
@@ -48,6 +48,11 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
<li>
|
||||
<a href="#banners" data-toggle="tab">
|
||||
Баннеры
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -442,6 +447,16 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<div id="banners" class="tab-pane">
|
||||
<script>
|
||||
window.TeleCart = {
|
||||
user_token: '{{ user_token }}',
|
||||
banners: '{{ banners }}',
|
||||
};
|
||||
</script>
|
||||
<div id="app">App Loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user