tethys/resources/assets/js/components/Dataset.vue

65 lines
1.1 KiB
Vue
Raw Normal View History

// <script>
2018-11-05 15:44:25 +00:00
import Vue from "vue";
//outside of the component:
function initialState() {
return {
type: "",
state: "",
rights: null,
project_id: "",
2019-01-22 17:31:46 +00:00
creating_corporation: "GBA Repository",
2019-01-24 15:56:39 +00:00
language: "en",
embargo_date: "",
belongs_to_bibliography: 0,
2018-11-05 15:44:25 +00:00
title_main: {
value: "",
language: ""
},
abstract_main: {
value: "",
language: ""
},
geolocation: {
xmin: "",
ymin: "",
xmax: "",
ymax: ""
},
checkedAuthors: [],
checkedLicenses: [], // [],
files: [],
references: [],
2019-01-22 17:24:18 +00:00
titles: [],
2019-01-24 16:33:04 +00:00
descriptions: [],
checkedContributors: [],
checkedSubmitters: [],
2018-11-05 15:44:25 +00:00
persons: [],
contributors: [],
submitters: []
};
}
2018-11-05 15:44:25 +00:00
const dataset = new Vue({
data: function() {
return initialState();
},
created: function() {
// let json = JSON.stringify(this.$data);
// this.reset = () => {
// Object.assign(this.$data, JSON.parse(json));
// };
// this.reset(json);
2018-11-05 15:44:25 +00:00
},
methods: {
reset() {
Object.assign(this.$data, initialState());
}
2018-11-05 15:44:25 +00:00
}
});
export default dataset;
//export { dataset };
2018-11-05 15:44:25 +00:00
</script>