Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting components #56

Merged
merged 10 commits into from
Jul 22, 2024
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
},
],
'vue/component-api-style': ['error', ['script-setup']],
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/component-name-in-template-casing': ['error', 'pascal-case'],
'vue/custom-event-name-casing': ['error', 'camelCase'],
'vue/v-on-event-hyphenation': ['error', 'always', { autofix: true }],
'vue/v-on-function-call': 'error',
Expand Down
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
/>
</head>
<body>
<div id="app"></div>
<script type="module" src="@/main.ts"></script>
<div id="app"><script type="module" src="/src/main.ts"></script></div>
</body>
</html>
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div :class="$style['inner-container']">
<main :class="$style.content">
<router-view />
<Avatar />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは消した方がいいかも

</main>
</div>
<footer>Footer</footer>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/DashBoard.vue
cp-20 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<div>Here is dashboard</div>
<div><MainHeader></MainHeader></div>
</template>

<script lang="ts" setup></script>
<script lang="ts" setup>
import MainHeader from '@/shared/lib/components/MainHeader.vue';
</script>

<style lang="scss" module></style>
Empty file removed src/shared/components/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions src/shared/lib/components/Chipcard.vue
cp-20 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
import Button from 'primevue/button';
</script>

<template>
<div>
<div class="p-button p-button-rounded p-button-outlined">
<span class="p-button-label">物品を登録</span>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrimeVueの<Button>使って無くないですか...?
使わない方針ならimportを消す / 使う方針なら使う、をしてほしいです~

</div>
</template>
14 changes: 14 additions & 0 deletions src/shared/lib/components/Chiptag.vue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should: パスカルケース (ChipTag) にしてほしいです!

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script setup lang="ts">
import { defineProps } from 'vue';

defineProps<{
name: string;
}>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo: nameよりはlabelの方が分りやすいかもです

</script>
<template>
<div>
<div class="p-chip">
<span>{{ name }}</span>
</div>
</div>
</template>
16 changes: 16 additions & 0 deletions src/shared/lib/components/Iconavatar.vue
cp-20 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script setup lang="ts">
import Avatar from 'primevue/avatar';
defineProps<{
name: string;
}>();
</script>
<template>
<div>
<Avatar
:image="`https://q.trap.jp/api/v3/public/icon/${name}`"
class="mr-2"
size="xlarge"
shape="circle"
/>
</div>
</template>
39 changes: 39 additions & 0 deletions src/shared/lib/components/MainHeader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template>
<div>
<div class="header">
<Iconavatar :name="dynamicName" />
</div>
<div class="content">
<Chiptag :name="dynamicName2" />
</div>
<div class="content">
<Chipcard></Chipcard>
</div>
</div>
</template>

<script lang="ts" setup>
import Iconavatar from '@/shared/lib/components/Iconavatar.vue';
import Chipcard from '@/shared/lib/components/Chipcard.vue';
import Chiptag from '@/shared/lib/components/Chiptag.vue';
const dynamicName = 'o_ER4'; // 実際は指定のユーザーの名前を取得する
const dynamicName2 = 'test1';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(疑問) ココには何が入る想定ですか?

</script>

<style lang="scss" module>
.header {
display: flex;
justify-content: flex-end;
align-items: center;
padding: 10px;
position: fixed;
top: 0;
right: 0;
left: 0;
background-color: white;
}

.content {
padding: 20px;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must: CSSが上手く動いてなさそう (というかtemplate内の要素との対応が上手くできてなさそう) なので、修正して欲しいです!

Flexbox or Grid について理解すると書けるようになるはずです! (分からないことがあれば聞いてください)

</style>
Loading