add basic QR functionality (#126)

This commit is contained in:
Jack Klika
2019-03-20 23:51:23 +08:00
committed by 1138-4EB
parent ed0ea34161
commit 4e15b82896
3 changed files with 34 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
<h1 class="share__box__title">{{ file.name }}</h1>
<qrcode-vue :value="fullLink" size="200" level="M"></qrcode-vue>
</div>
</div>
</a>
@@ -23,9 +24,13 @@
<script>
import { share as api } from '@/api'
import { baseURL } from '@/utils/constants'
import QrcodeVue from 'qrcode.vue'
export default {
name: 'share',
components: {
QrcodeVue
},
data: () => ({
loaded: false,
notFound: false,
@@ -44,6 +49,9 @@ export default {
link: function () {
return `${baseURL}/api/public/dl/${this.hash}`
},
fullLink: function () {
return window.location.origin + this.link
},
},
methods: {
fetchData: async function () {