Skip to content

Commit 30c3ea6

Browse files
authored
fix(ts-warning):Property does not exist on type 'never' (vuejs#1994)
* fix(ts-warning):Property does not exist on type 'never' * fix(ts-warning):Property does not exist on type 'never' * removing nonexistent module * fix: indentations and move items and it's types to script tag
1 parent 7e9f1e6 commit 30c3ea6

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

.vitepress/theme/components/VueJobs.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
<script lang="ts">
22
// shared data across instances so we load only once
3-
const base = `https://app.vuejobs.com/feed/vuejs/docs?format=json`
4-
let items = $ref([])
3+
const base = 'https://app.vuejobs.com/feed/vuejs/docs?format=json'
4+
5+
let items = $ref<Jobs[]>([])
6+
7+
type Jobs = {
8+
organization: Organization;
9+
title: string;
10+
link: string;
11+
locations: string[];
12+
remote: false | 'ALLOWED' | 'ONLY';
13+
};
14+
15+
type Organization = {
16+
name: string;
17+
avatar: string;
18+
};
519
</script>
620

721
<script setup lang="ts">
@@ -29,23 +43,21 @@ onMounted(async () => {
2943
target="_blank"
3044
>
3145
<div class="vj-company-logo">
32-
<img :src="job.organization.avatar" alt="" />
46+
<img
47+
:src="job.organization.avatar"
48+
:alt="`Logo for ${job.organization.name}`" />
3349
</div>
3450
<div
3551
style="
3652
overflow: hidden;
3753
display: flex;
3854
flex-direction: column;
3955
justify-content: center;
40-
"
41-
>
56+
">
4257
<div class="vj-job-title">{{ job.title }}</div>
4358
<div class="vj-job-info">
4459
{{ job.organization.name }} <span>· </span>
45-
<span v-if="['ONLY', 'ALLOWED'].includes(job.remote)"
46-
>Remote</span
47-
>
48-
<span v-else>{{ job.locations[0] }}</span>
60+
<span>{{ job.remote ? 'Remote' : job.locations[0] }}</span>
4961
</div>
5062
</div>
5163
</a>

0 commit comments

Comments
 (0)