mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-09-23 12:29:27 +08:00
New data system
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user