I've experimented with various approaches, but so far I've only managed to get this code working:
// This works
<script setup lang="ts">
import { reactive } from 'vue'
import { IPixabayItem } from '../interfaces/IPixapayItem'
const imageList: IPixabayItem[] = []
const foundImages = reactive(
{
images: imageList
}
)
</script>
I'm trying to find a way to eliminate the use of the 'imageList' constant and instead initialize the 'IPixabayItem[]' directly inside the reactive object. However, I haven't been able to make that work during transpilation.
// This doesn't work
<script setup lang="ts">
import { reactive } from 'vue'
import { IPixabayItem } from '../interfaces/IPixapayItem'
const foundImages = reactive(
{
images: IPixabayItem[] = []
}
)
</script>
Any help would be greatly appreciated.