I am trying to run a simple pug for loop inside of my nuxt app.
I installed https://www.npmjs.com/package/vue-pug-loader by running the commands, and the syntax seems to work:
<template lang="pug">
if (10 / 2) == 5
p Hello world!
</template>
This shows hello world correctly, so does a for loop like
<template lang="pug">
for item in ["1", "2", "3"]
p #{item}
</template>
But whenever I try and use a variable from my script It throws an error:
Cannot read properties of undefined (reading 'length')
<template lang="pug">
for item in pages // error triggers here
p #{item}
</template>
<script>
let pages = ["1", "2", "3"]
</script>
<style>
</style>
What am I doing wrong?