Highlightjs vue cannot update in real time

the code is as follows:

<no-ssr placeholder="" v-highlight>
      
{{mycode}}<code style="atom-one-dark" :class="myCodeClass">{{mycode}}
< / no-ssr >
const hljs = require("highlight.js");

    Vue.directive("highlight", {

        

        inserted: el => {

            let blocks = el.querySelectorAll("pre code");

            blocks.forEach( (block) => {
                hljs.highlightBlock(block);
            });

            console.log("test1");

        },

        componentUpdated: el => {

            let blocks = el.querySelectorAll("pre code");

            blocks.forEach( (block) => {
                hljs.highlightBlock(block);
            });

            console.log("test22", blocks);

        },

    });

when the variable mycode is updated, the {{mycode}} in html is updated in real time. But the code displayed by highlightjs is still the old code, how to solve it?

Mar.28,2021

solved it on its own.
I find that people have already written plug-ins. Specifically, you can look at other people's source code implementation:
https://github.com/metachris/.


how to solve it? I have also encountered this problem here


has been used, but it has no effect

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38e51-406d9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38e51-406d9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?