Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/guide/essentials/computed.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ export default {
// 条件を満たした最後の値が代わりに返されます
alwaysSmall(previous) {
if (this.count <= 3) {
return this.count;
return this.count
}

return previous;
return previous
}
}
}
Expand All @@ -304,10 +304,10 @@ const count = ref(2)
// 条件を満たした最後の値が代わりに返されます
const alwaysSmall = computed((previous) => {
if (count.value <= 3) {
return count.value;
return count.value
}

return previous;
return previous
})
</script>
```
Expand All @@ -328,13 +328,13 @@ export default {
alwaysSmall: {
get(previous) {
if (this.count <= 3) {
return this.count;
return this.count
}

return previous;
},
set(newValue) {
this.count = newValue * 2;
this.count = newValue * 2
}
}
}
Expand All @@ -353,13 +353,13 @@ const count = ref(2)
const alwaysSmall = computed({
get(previous) {
if (count.value <= 3) {
return count.value;
return count.value
}

return previous;
return previous
},
set(newValue) {
count.value = newValue * 2;
count.value = newValue * 2
}
})
</script>
Expand Down
6 changes: 3 additions & 3 deletions src/guide/typescript/composition-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Vue 3.5 と `@vue/language-tools` 2.1(IDE の言語サービスと `vue-tsc`
自動推論が不可能な場合でも、ジェネリック引数を使用してテンプレート参照を明示的な型にキャストすることができます:

```ts
const el = useTemplateRef<HTMLInputElement>(null)
const el = useTemplateRef<HTMLInputElement>('el')
```

<details>
Expand Down Expand Up @@ -438,7 +438,7 @@ const compRef = useTemplateRef<FooType | BarType>('comp')
import { useTemplateRef } from 'vue'
import type { ComponentPublicInstance } from 'vue'

const child = useTemplateRef<ComponentPublicInstance | null>(null)
const child = useTemplateRef<ComponentPublicInstance>('child')
```

参照されるコンポーネントが[ジェネリックコンポーネント](/guide/typescript/overview.html#generic-components)の場合、例えば `MyGenericModal` の場合:
Expand Down Expand Up @@ -467,7 +467,7 @@ import { useTemplateRef } from 'vue'
import MyGenericModal from './MyGenericModal.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'

const modal = useTemplateRef<ComponentExposed<typeof MyGenericModal>>(null)
const modal = useTemplateRef<ComponentExposed<typeof MyGenericModal>>('modal')

const openModal = () => {
modal.value?.open('newValue')
Expand Down