createCopyUrl to _category.vue

This commit is contained in:
Unknown
2019-08-13 20:15:05 -05:00
parent 5d1e205a19
commit 0a8c7ebc28
3 changed files with 16 additions and 40 deletions

View File

@@ -3,31 +3,14 @@
p.card--title {{resource.title}}
p.card--description {{resource.desc}}
.card--links
a.card--reference(@click='createCopyUrl') Copy
a.card--reference(@click='createCopyUrl(resource)') Copy
br
a.card--target(:href="resource.url" :target='resource.title' rel='noreferrer') Open
</template>
<script>
export default {
props: ['resource', 'isActive'],
data(){
return {}
},
methods: {
async createCopyUrl() {
try {
const { path } = this.resource
await this.$copyText(`https://webgems.io${path}`)
this.$emit('toggle', 'test')
this.$router.push(path)
} catch (e) {
console.error(e);
}
},
},
mounted() {},
watch: {},
props: ['resource', 'isActive', 'createCopyUrl'],
}
</script>

View File

@@ -5,31 +5,14 @@
td.tableRow--links
tr
td
a.tableRow--reference(@click='createCopyUrl') Copy
a.tableRow--reference(@click='createCopyUrl(resource)') Copy
td
a.tableRow--target(:href="resource.url" :target='resource.title' rel='noreferrer') Open
</template>
<script>
export default {
props: ['resource', 'isActive'],
data() {
return {};
},
methods: {
async createCopyUrl() {
try {
const { path } = this.resource
await this.$copyText(`https://webgems.io${path}`)
this.$emit('toggle', 'test')
this.$router.push(path)
} catch (e) {
console.error(e);
}
},
},
mounted() {},
watch: {},
props: ['resource', 'isActive', 'createCopyUrl'],
};
</script>