Skip to content
Snippets Groups Projects
Commit 298e950e authored by syuilo's avatar syuilo
Browse files

refactor(client): use composition api

parent f02ed78a
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div class="jmelgwjh"> <MkSpacer :content-max="800">
<div class="body"> <XNotes :pagination="pagination" :detail="true" :prop="'note'"/>
<XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'"/> </MkSpacer>
</div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -15,7 +13,7 @@ const pagination = { ...@@ -15,7 +13,7 @@ const pagination = {
endpoint: 'i/favorites', endpoint: 'i/favorites',
limit: 10, limit: 10,
params: () => ({ params: () => ({
}) }),
}; };
defineExpose({ defineExpose({
...@@ -26,16 +24,3 @@ defineExpose({ ...@@ -26,16 +24,3 @@ defineExpose({
}, },
}); });
</script> </script>
<style lang="scss" scoped>
.jmelgwjh {
background: var(--bg);
> .body {
box-sizing: border-box;
max-width: 800px;
margin: 0 auto;
padding: 16px;
}
}
</style>
...@@ -4,29 +4,22 @@ ...@@ -4,29 +4,22 @@
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent } from 'vue';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
import { i18n } from '@/i18n';
export default defineComponent({ const pagination = {
components: { endpoint: 'notes/featured',
XNotes limit: 10,
}, offsetMode: true,
};
data() { defineExpose({
return { [symbols.PAGE_INFO]: {
[symbols.PAGE_INFO]: { title: i18n.locale.featured,
title: this.$ts.featured, icon: 'fas fa-fire-alt',
icon: 'fas fa-fire-alt', bg: 'var(--bg)',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/featured',
limit: 10,
offsetMode: true,
},
};
}, },
}); });
</script> </script>
...@@ -4,28 +4,21 @@ ...@@ -4,28 +4,21 @@
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent } from 'vue';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
import { i18n } from '@/i18n';
export default defineComponent({ const pagination = {
components: { endpoint: 'notes/mentions',
XNotes limit: 10,
}, };
data() { defineExpose({
return { [symbols.PAGE_INFO]: {
[symbols.PAGE_INFO]: { title: i18n.locale.mentions,
title: this.$ts.mentions, icon: 'fas fa-at',
icon: 'fas fa-at', bg: 'var(--bg)',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/mentions',
limit: 10,
},
};
}, },
}); });
</script> </script>
...@@ -4,31 +4,24 @@ ...@@ -4,31 +4,24 @@
</MkSpacer> </MkSpacer>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { defineComponent } from 'vue';
import XNotes from '@/components/notes.vue'; import XNotes from '@/components/notes.vue';
import * as symbols from '@/symbols'; import * as symbols from '@/symbols';
import { i18n } from '@/i18n';
export default defineComponent({ const pagination = {
components: { endpoint: 'notes/mentions',
XNotes limit: 10,
}, params: () => ({
visibility: 'specified'
}),
};
data() { defineExpose({
return { [symbols.PAGE_INFO]: {
[symbols.PAGE_INFO]: { title: i18n.locale.directNotes,
title: this.$ts.directNotes, icon: 'fas fa-envelope',
icon: 'fas fa-envelope', bg: 'var(--bg)',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/mentions',
limit: 10,
params: () => ({
visibility: 'specified'
})
},
};
}, },
}); });
</script> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment