refs #118 Add attache button in new toot modal

This commit is contained in:
AkiraFukushima 2018-03-29 12:09:28 +09:00
parent e9304e5378
commit 6383705187
1 changed files with 22 additions and 3 deletions

View File

@ -9,11 +9,15 @@
<textarea v-model="status" ref="status" @keyup.meta.enter.exact="toot" @keyup.ctrl.enter.exact="toot" @keyup.enter.exact="enter" @keydown="keydown" @keyup="keyup"></textarea>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer">
<div class="upload-image">
<el-button size="small" type="text" @click="selectImage"><icon name="camera"></icon></el-button>
<input name="image" type="file" class="image-input" ref="image" />
</div>
<span class="text-count">{{ 500 - status.length }}</span>
<el-button @click="close">Cancel</el-button>
<el-button type="primary" @click="toot">Toot</el-button>
</span>
</div>
</el-dialog>
</template>
@ -24,7 +28,8 @@ export default {
name: 'new-toot',
data () {
return {
ctrlPressed: false
ctrlPressed: false,
attachedFiles: []
}
},
computed: {
@ -109,6 +114,12 @@ export default {
type: 'error'
})
})
},
selectImage () {
this.$refs.image.click()
},
uploadImage (e) {
console.log(e.target.files)
}
}
}
@ -154,6 +165,14 @@ export default {
.el-dialog__footer {
background-color: #f2f6fc;
.upload-image {
text-align: left;
.image-input {
display: none;
}
}
.text-count {
padding-right: 24px;
color: #909399;