Started working on modal dialogues.

このコミットが含まれているのは:
テクニカル諏訪子 2018-02-01 04:50:05 +09:00
コミット 2c311b5012
1個のファイルの変更73行の追加0行の削除

ファイルの表示

@ -0,0 +1,73 @@
<template>
<div class="panel panel-default">
<div class="panel-heading">
<!--@lang('entry.changelog', ['version' => '2.0'])-->
Changes in {{ version }}
</div>
<div class="panel-body">
<div class="container">
<div class="row">
<div class="col-md-12">
{{ changelog }}
</div>
</div>
</div>
</div>
</div>
</template>
<script>
// https://adamwathan.me/2016/01/04/composing-reusable-modal-dialogs-with-vuejs/
export default {
name: 'entry-changelog',
props: [
'fid',
'show'
],
data: function () {
return {
id: this.fid,
title: '',
version: '',
notice: '',
files: []
}
},
created: function () {
axios.get('/api/rpc/file/getfile/' + this.id).then(res => {
this.title = res.data[0].title;
this.version = res.data[0].version;
if (res.data[0].warningnote !== '') this.notice = res.data[0].warningnote;
});
this.files.push(
{
'filename': 'test1.carc',
'filesize': '1000 TiB'
},
{
'filename': 'test2.carc',
'filesize': '20 GiB'
}
);
},
methods: {
close: function () {
this.$emit('close');
}
},
mounted: function () {
document.addEventListener("keydown", e => {
if (this.show && e.keyCode == 27) { // TODO: keyCode is deprecated; use alternative!
this.close();
}
});
}
}
</script>
<style>
.col {
text-align: center;
}
</style>