Skip to content

Commit

Permalink
add basic QR functionality (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackklika authored and 1138-4EB committed Mar 20, 2019
1 parent ed0ea34 commit 4e15b82
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -17,6 +17,7 @@
"moment": "^2.24.0",
"normalize.css": "^8.0.1",
"noty": "^3.2.0-beta",
"qrcode.vue": "^1.6.1",
"vue": "^2.6.9",
"vue-i18n": "^8.9.0",
"vue-router": "^3.0.2",
Expand Down
8 changes: 8 additions & 0 deletions src/views/Share.vue
Expand Up @@ -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>
Expand All @@ -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,
Expand All @@ -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 () {
Expand Down

0 comments on commit 4e15b82

Please sign in to comment.