A
A
Alexander2022-04-01 18:30:20
1C-Bitrix
Alexander, 2022-04-01 18:30:20

Why can't VueDevtools see Vuex?

Subject. The repository is working, but VueDevtools doesn't see it as if it doesn't exist.

You have to do in one of the components:

computed: {
    store_mirror() {
      return this.$store.state;
    },
...

To at least see the state.

PS
Please do not remove the Bitrix tag, because speech and vue and vuex are connected from the core, and not vanilla.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2022-04-05
@Firsov36

On the page where Vue / Vuex is connected, you need to define the constant VUEJS_DEBUG
Example:

<?php

const VUEJS_DEBUG = true;

use Bitrix\Main\UI\Extension;

/* @global CMain $APPLICATION */

require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");

Extension::load("ui.vue");
Extension::load('sergey.mymodule.isthebest');
?>
<section>
    <div id="mymodule"></div>
    
    <script>
        BX.ready(function() {
          BX.Vue.create({
            el: '#mymodule',
            template: `<mymodule-isthebest />`
          })
        })
    </script>
</section>

<?php
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question