update files

This commit is contained in:
Nuintun
2015-11-20 17:45:23 +08:00
parent b31cda4eab
commit 37587ea685
5 changed files with 33 additions and 18 deletions

View File

@@ -29,8 +29,10 @@ module.exports = Vue.component('project-base', {
};
},
methods: {
focus: function (key){
this[key] = '';
focus: function (key, event){
if (event.target.type === 'text') {
this[key] = '';
}
}
},
events: {

View File

@@ -1,12 +1,12 @@
<li>
<label>项目名称:</label>
<input type="text" v-model="name" placeholder="项目名称" lazy @focus="focus('nameError')"/>
<input type="text" v-model="name" placeholder="项目名称" lazy @focus="focus('nameError', $event)"/>
</li>
<li v-show="nameError" class="ui-item-error">
<label class="fn-invisible">&emsp;&emsp;&emsp;&emsp;&emsp;</label>
<span><i class="icon-expand"></i>{{ nameError }}</span>
</li>
<li @focusin="focus('pathError')">
<li @focusin="focus('pathError', $event)">
<directory label="项目路径" :path.sync="path"></directory>
</li>
<li v-show="pathError" class="ui-item-error">