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