refs #3301 Rewrite organisms/Notification/Mention with composition API

This commit is contained in:
AkiraFukushima 2022-05-22 00:54:48 +09:00
parent 0308442dcf
commit 54ba3bd12a
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 26 additions and 19 deletions

View File

@ -16,37 +16,44 @@
</div> </div>
</template> </template>
<script> <script lang="ts">
import Toot from '../Toot' import { defineComponent, PropType } from 'vue'
import { Entity } from 'megalodon'
import Toot from '../Toot.vue'
export default { export default defineComponent({
name: 'mention', name: 'mention',
props: { props: {
message: { message: {
type: Object, type: Object as PropType<Entity.Notification>,
default: {}, default: {}
}, },
filters: { filters: {
type: Array, type: Array as PropType<Array<Entity.Filter>>,
default: [], default: []
}, },
focused: { focused: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
overlaid: { overlaid: {
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
components: { Toot }, components: { Toot },
methods: { setup(_props, ctx) {
updateToot(message) { const updateToot = message => {
return this.$emit('update', message) return ctx.emit('update', message)
}, }
deleteToot(message) { const deleteToot = message => {
return this.$emit('delete', message) return ctx.emit('delete', message)
}, }
},
} return {
updateToot,
deleteToot
}
}
})
</script> </script>