hi there, i’m fiddling with writing an app for nextcloud but i’m stuck on one issue i fail to solve:
App.vue:
<template>
<NcAppContent>
<div>
<table>
<thead>
<tr>
<th>Description</th>
<th>Status</th>
<th>Deactivation Time</th>
<th />
<th>Activate for</th>
<th />
</tr>
</thead>
<tbody>
<tr v-for="{ rule } in rules"
:key="rule.id"
class="internetaccess_address">
<td>{{ rule.description }}</td>
<td :class="[rule.status ? icon-play : icon-close, shaded]" />
<td>{{ rule.eventtime }}</td>
<td class="icon-close" />
<td />
<td class="icon-play" />
</tr>
</tbody>
</table>
</div>
</NcAppContent>
</template>
<script>
import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import { loadState } from '@nextcloud/initial-state'
export default {
name: 'App',
components: {
NcAppContent,
},
data() {
return {
rules: loadState('ui_internetaccess', 'rules-initial-state'),
}
},
mounted() {
console.log(this.rules)
},
}
</script>
<style scoped lang="scss">
#ui_internetaccess {
display: flex;
justify-content: center;
margin: 16px;
}
</style>
while console.log(this.rules)
in mounted
puts out the correct data in the browser’s console the view does not render claiming that
Property or method “rules” is not defined on the instance but referenced during render.
the provided link doesn’t help me much because it tells me to declare rules
in the data
-section which i obviously have…
any pointers are highly appreciated!