refs #3301 Rewrite molecules/Toot/LinkPreview with composition API

This commit is contained in:
AkiraFukushima 2022-05-21 00:35:06 +09:00
parent e08191edc3
commit feb4ba7131
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 12 additions and 8 deletions

View File

@ -12,8 +12,10 @@
</div>
</template>
<script>
export default {
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'link-preview',
props: {
icon: {
@ -33,14 +35,16 @@ export default {
default: null
}
},
methods: {
openLink(link) {
if (link) {
return window.shell.openExternal(link)
}
setup() {
const openLink = (link: string) => {
;(window as any).shell.openExternal(link)
}
return {
openLink
}
}
}
})
</script>
<style lang="scss">