TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
178 stars 54 forks source link

codemirror.js Uncaught TypeError: how can I solve? #224

Closed givemetarte closed 1 year ago

givemetarte commented 1 year ago

Hi,

I got a trouble when I'm using the yasgui in my vue3 application. The three tabs are generated but when I clicked the sparql query lines, a error message is arising. The message is below: Screenshot 2023-05-21 at 8 59 16 PM

Additionally, lots of blank lines are generated and the scroll bar is not at the beginning of the first line. Screenshot 2023-05-21 at 9 01 10 PM

I have no idea how can I solve..😹 I'll be so pleased if you give me some clues.

The source codes are below:

<template> 
    <div id="yasgui"></div>
</template>

<script>
import { ref, onMounted } from 'vue';
import Yasgui from "@triply/yasgui";
import "@triply/yasgui/build/yasgui.min.css";

export default ({
    name: 'QuerySection',
    setup() {
        const yasgui = ref(null);

        // set queries
        const basicQuery = "blah blah blah..."
        const secQuery = "blah blah blah..."
        const thdQuery = "blah blah blah..."

        onMounted(() => {
            yasgui.value = new Yasgui(document.getElementById("yasgui"), {
                requestConfig: { endpoint: import.meta.env.VITE_KEY_SPARQL_ENDPOINT }, 
                copyEndpointOnNewTab: true,
                persistencyExpire: 1,
                yasqe: {
                    persistencyExpire: 1,
                }
            })

            // add tabs and queries
            yasgui.value.getTab().setQuery(basicQuery);
            yasgui.value.addTab('query2').setQuery(secQuery);
            yasgui.value.addTab('query3').setQuery(thdQuery);
        })

        return { yasgui }
    },
})
</script>
givemetarte commented 1 year ago

error fixed!