New data system

This commit is contained in:
MattIPv4
2020-04-27 23:22:38 +01:00
parent 4c22ba571a
commit e6b8d36068
10 changed files with 383 additions and 88 deletions

View File

@@ -3,7 +3,46 @@
</template>
<script>
import i18n from '../../i18n';
const defaults = {
root: true,
index: 'index.php',
fallbackRouting: ['index.php'],
legacyPhpRouting: false,
};
export default {
name: 'DomainRouting',
props: {
data: Object,
},
data () {
return {
i18n,
defaults,
...defaults,
};
},
created () {
if (this.$props.data) {
for (const key in this.$props.data) {
if (key in defaults) {
this.$data[key] = this.$props.data[key];
}
}
}
},
methods: {
exports() {
return Object.keys(defaults).reduce((prev, key) => {
prev[key] = this.$data[key];
return prev;
}, {});
},
changes() {
return Object.keys(defaults).filter(key => defaults[key] !== this.$data[key]).length;
},
},
};
</script>