mirror of
https://github.com/nuintun/command-manager.git
synced 2025-10-20 09:51:31 +08:00
update files
This commit is contained in:
49
static/js/components/project-base/index.js
Normal file
49
static/js/components/project-base/index.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/20.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var Vue = require('../../vue/vue');
|
||||
|
||||
module.exports = Vue.component('app-configure', {
|
||||
template: fs.readFileSync(path.join(__dirname, 'project-base.html')).toString(),
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
twoWay: true,
|
||||
default: ''
|
||||
},
|
||||
path: {
|
||||
type: String,
|
||||
twoWay: true,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data: function (){
|
||||
return {
|
||||
nameError: '',
|
||||
pathError: ''
|
||||
};
|
||||
},
|
||||
events: {
|
||||
'submit': function (){
|
||||
this.name = this.name.trim();
|
||||
this.path = this.path.trim();
|
||||
|
||||
if (this.name) {
|
||||
this.nameError = '';
|
||||
} else {
|
||||
this.nameError = '项目名称不能为空';
|
||||
}
|
||||
|
||||
if (this.path) {
|
||||
this.pathError = '';
|
||||
} else {
|
||||
this.pathError = '项目路径不能为空';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
15
static/js/components/project-base/project-base.html
Normal file
15
static/js/components/project-base/project-base.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<li>
|
||||
<label>项目名称:</label>
|
||||
<input type="text" v-model="name" placeholder="项目名称"/>
|
||||
</li>
|
||||
<li v-show="nameError" class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>{{ nameError }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<directory label="项目路径" :path.sync="path"></directory>
|
||||
</li>
|
||||
<li v-show="pathError" class="ui-item-error">
|
||||
<label class="fn-invisible">     </label>
|
||||
<span><i class="icon-expand"></i>{{ pathError }}</span>
|
||||
</li>
|
Reference in New Issue
Block a user