I'm in the process of developing a Nuxt website and I need to be able to edit a specific JavaScript file after building in order to update the content of a table. Does anyone have any suggestions on how I can achieve this?
So far, my attempts to include the JavaScript file as a plugin have been unsuccessful. Additionally, my efforts to replace the script with the following code have also failed:
<!-- my-component.vue -->
<template>
<div>This is a Text!</div>
</template>
<script src="./my-outsourced-script.js"></script>
Currently, my code looks like this:
Bootstrap-Vue table:
<b-table
borderless
striped
hover
responsive
:sticky-header="stickyHeader"
:items="folderPermissions"
:fields="folderGroups"
>
</b-table>
Content that needs to be replaced:
export default {
data() {
return {
stickyHeader: true,
keyword: '',
sortBy: 'xxx',
sortDesc: false,
folderGroups: [
{
key: 'drive',
stickyColumn: true,
label: ' ',
isRowHeader: true
},
...
],
folderPermissions: [
{
drive: 'Some Text',
id: 0,
a: 1
},
...
]
}
}
}
My goal is to have the folderGroups
and folderPermissions
from the code above in an external JavaScript file for easy editing and to see the changes reflected on the website.