update files

This commit is contained in:
Nuintun
2015-11-20 13:52:10 +08:00
parent bee7f0940e
commit 05a99b46ac
22 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,3 @@
<label>{{label}}</label>
<input type="text" :title="path" :placeholder="label" v-model="path" lazy/>&nbsp;
<a title="选择项目" href="javascript:;" class="icon-ellipsis" @click="open"></a>

View File

@@ -0,0 +1,39 @@
/**
* Created by nuintun on 2015/11/17.
*/
'use strict';
var fs = require('fs');
var path = require('path');
var ipc = require('ipc-renderer');
var Vue = require('../../vue/vue');
module.exports = Vue.component('directory', {
// camelCase in JavaScript
props: {
label: {
type: String,
required: true
},
path: {
type: String,
default: ''
}
},
template: fs.readFileSync(path.join(__dirname, 'directory.html')).toString(),
methods: {
open: function (){
ipc.send('open-directory', this.path, this._uid);
}
},
created: function (){
var context = this;
ipc.on('select-directory', function (event, paths, uid){
if (context._uid === uid) {
context.path = paths[0];
}
});
}
});