mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-12-01 14:27:33 -07:00
refactor(client): use setup syntax
This commit is contained in:
parent
97b4d43871
commit
baa5ddfb75
1 changed files with 64 additions and 95 deletions
|
@ -72,8 +72,8 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent, ref, onMounted, onUnmounted, watch } from 'vue';
|
import { ref, onMounted, onUnmounted, watch } from 'vue';
|
||||||
import * as misskey from 'misskey-js';
|
import * as misskey from 'misskey-js';
|
||||||
import XReactionIcon from './reaction-icon.vue';
|
import XReactionIcon from './reaction-icon.vue';
|
||||||
import MkFollowButton from './follow-button.vue';
|
import MkFollowButton from './follow-button.vue';
|
||||||
|
@ -86,29 +86,15 @@ import * as os from '@/os';
|
||||||
import { stream } from '@/stream';
|
import { stream } from '@/stream';
|
||||||
import { useTooltip } from '@/scripts/use-tooltip';
|
import { useTooltip } from '@/scripts/use-tooltip';
|
||||||
|
|
||||||
export default defineComponent({
|
const props = withDefaults(defineProps<{
|
||||||
components: {
|
notification: misskey.entities.Notification;
|
||||||
XReactionIcon, MkFollowButton,
|
withTime?: boolean;
|
||||||
},
|
full?: boolean;
|
||||||
|
}>(), {
|
||||||
|
withTime: false,
|
||||||
|
full: false,
|
||||||
|
});
|
||||||
|
|
||||||
props: {
|
|
||||||
notification: {
|
|
||||||
type: Object,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
withTime: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
full: {
|
|
||||||
type: Boolean,
|
|
||||||
required: false,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
setup(props) {
|
|
||||||
const elRef = ref<HTMLElement>(null);
|
const elRef = ref<HTMLElement>(null);
|
||||||
const reactionRef = ref(null);
|
const reactionRef = ref(null);
|
||||||
|
|
||||||
|
@ -172,23 +158,6 @@ export default defineComponent({
|
||||||
targetElement: reactionRef.value.$el,
|
targetElement: reactionRef.value.$el,
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
|
||||||
getNoteSummary: (note: misskey.entities.Note) => getNoteSummary(note),
|
|
||||||
followRequestDone,
|
|
||||||
groupInviteDone,
|
|
||||||
notePage,
|
|
||||||
userPage,
|
|
||||||
acceptFollowRequest,
|
|
||||||
rejectFollowRequest,
|
|
||||||
acceptGroupInvitation,
|
|
||||||
rejectGroupInvitation,
|
|
||||||
elRef,
|
|
||||||
reactionRef,
|
|
||||||
i18n,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Loading…
Reference in a new issue