Skip to content

Instantly share code, notes, and snippets.

@JCharante
Created July 17, 2017 21:37
Show Gist options
  • Save JCharante/4b4d52fa5157df25aa751a9e9ee556e4 to your computer and use it in GitHub Desktop.
Save JCharante/4b4d52fa5157df25aa751a9e9ee556e4 to your computer and use it in GitHub Desktop.
<template>
<q-modal minimized ref="modal" :content-css="{padding: '50px'}">
<q-item>
<q-item-main>
<q-field float-label="Link to File">
<q-input ref="link" v-model="shareLink"></q-input>
</q-field>
</q-item-main>
<q-item-side>
<q-btn icon="fa-clipboard" outline color="deep-orange" @click="copySelectionToClipboard()">Copy</q-btn>
</q-item-side>
</q-item>
</q-modal>
</template>
<script>
import {
QModal,
QItem,
QItemMain,
QItemSide,
QField,
QInput,
QBtn
} from 'quasar'
export default {
components: {
QModal,
QItem,
QItemMain,
QItemSide,
QField,
QInput,
QBtn
},
mounted () {
// Select the <input> under this.$refs.link
},
methods: {
copySelectionToClipboard () {
document.execCommand('copy')
}
},
data () {
return {
shareLink: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment