Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jasonrudland's avatar

New Page from Nova Resource Tool

OK, so I'm a bit confused about where to go with a Nova resource tool I've built. My resource tool allows the user to select a quiz from a dropdown, and generate a new 'take' - i.e. an instance of taking the selected quiz. It adds the 'take' to a list under the dropdown and all is good....

What I wanted to do from here is to click on a 'take' in the list and open a new browser window, so the user can see all the questions in a list and answer them. I worked out how to add a blade template to my resource tool and how to pass the quiz data to the new page to render.

But...I wanted to use Vue in the new window, and this is where I come unstuck. I can't work out how to import vue and use it. I keep getting a 'Uncaught SyntaxError: Unexpected identifier' on my import statement??

<script>

        import Quiz from "../resources/js/components/Quiz.vue";  //  Uncaught SyntaxError: Unexpected identifier

        const app = new Vue({
            el: '#app',
                components: { Quiz } 
        });

</script>

I thought of creating a new tool just to be the quiz 'take' page, but I can't work out how I would pass the data to that?

I'm not sure if I'm being thick, or just approaching this in the wrong way?

Any suggestions?

0 likes
1 reply
jasonrudland's avatar

So I was too close to the problem with not enough sleep!

In case it helps anyone else, here is what I did:

I created a new custom tool to take the quiz. I then linked to the url from my resource tool with a url parameter so I could load the quiz data in the new tool.

It still seems a bit clunky to me...I have to do additional server loads for the data in the new tool. Also, where I was trying to build a component I could package up and use on other projects, I now have two components - do they both get bundled into a single package?

Ah, the pleasure of learning new stuff....

Please or to participate in this conversation.