diff options
| -rw-r--r-- | views/mods/mod_productvariants/produkt_addedit_content.phtml | 20 | ||||
| -rw-r--r-- | views/produkt/addedit_productcodes.phtml | 18 |
2 files changed, 15 insertions, 23 deletions
diff --git a/views/mods/mod_productvariants/produkt_addedit_content.phtml b/views/mods/mod_productvariants/produkt_addedit_content.phtml index 657cd21..415ad76 100644 --- a/views/mods/mod_productvariants/produkt_addedit_content.phtml +++ b/views/mods/mod_productvariants/produkt_addedit_content.phtml @@ -148,19 +148,13 @@ </div>
</div>
- <?php $GLOBALS['wpsg_vue_3.2.47_loaded'] = ($GLOBALS['wpsg_vue_3.2.47_loaded']??0) + 1; if ($GLOBALS['wpsg_vue_3.2.47_loaded'] <= 1) { ?>
- <script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue-3.2.47.global.min.js'; ?>"></script>
- <?php } ?>
-
- <script>
+ <script type="module">
- (() => {
-
- const ref = Vue.ref;
- const computed = Vue.computed;
- const onMounted = Vue.onMounted;
-
- const app = Vue.createApp({
+ import { ref, createApp, onMounted, computed } from '/wp-content/plugins/wpsg_ticket/assets/js/vue.esm-browser.js';
+
+ document.addEventListener('DOMContentLoaded', () => {
+
+ const app = createApp({
setup() {
const product_id = ref(<?php echo $oProduct->getId(); ?>);
@@ -418,7 +412,7 @@ });
- })();
+ });
</script>
diff --git a/views/produkt/addedit_productcodes.phtml b/views/produkt/addedit_productcodes.phtml index 065eb86..ca81d51 100644 --- a/views/produkt/addedit_productcodes.phtml +++ b/views/produkt/addedit_productcodes.phtml @@ -75,19 +75,17 @@ </div> - <?php $GLOBALS['wpsg_vue_3.2.47_loaded'] = ($GLOBALS['wpsg_vue_3.2.47_loaded']??0) + 1; if ($GLOBALS['wpsg_vue_3.2.47_loaded'] <= 1) { ?> - <script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue-3.2.47.global.min.js'; ?>"></script> - <?php } ?> - <script> + + import { ref, createApp, onMounted, computed } from '/wp-content/plugins/wpsg_ticket/assets/js/vue.esm-browser.js'; - (() => { + document.addEventListener('DOMContentLoaded', function() { - const ref = Vue.ref; - const computed = Vue.computed; - const onMounted = Vue.onMounted; + const ref = ref; + const computed = computed; + const onMounted = onMounted; - const app = Vue.createApp({ + const app = createApp({ setup() { const data = ref(<?php echo json_encode($arData); ?>); @@ -131,7 +129,7 @@ } }).mount('#wpsg_mod_productcodes_app'); - })(); + }); </script> |
