update files

This commit is contained in:
nuintun
2015-11-23 15:23:34 +08:00
parent 469ebd9744
commit ea69932db8
6 changed files with 105 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
<project-configure :project.sync="project"></project-configure>
<project-configure :project="project" :unique-projects.sync="uniqueProjects"></project-configure>
<div class="ui-project-stage fn-hide">
<div class="ui-control-bar fn-clear">
<div class="ui-control-operate fn-left">

View File

@@ -28,14 +28,12 @@ module.exports = Vue.component('app-main', {
required: true
}
},
data: function (){
return {};
},
computed: {
project: function (){
var project = this.projects[this.activeIndex] || {
name: '',
path: '',
env: [],
command: []
};
var project = this.projects[this.activeIndex];
if (!project.env) {
project.env = [];
@@ -45,7 +43,19 @@ module.exports = Vue.component('app-main', {
project.command = [];
}
return project;
return JSON.parse(JSON.stringify(project));
}
},
methods: {
remove: function (){
this.projects.splice(this.activeIndex, 1);
this.$dispatch('save-configure');
}
},
events: {
edit: function (project){
this.projects.$set(this.activeIndex, project);
this.$dispatch('save-configure');
}
}
});