1๐
โ
I do not know what that Viewer object is. Your template cannot access the items object.
You can use the script setup :
<script setup>
import { ref } from 'vue'
const items = ref([{ message: 'Foo' }, { message: 'Bar' }])
</script>
or the default script :
<script>
import { ref } from 'vue'
export default {
setup (props) {
const items = ref([{ message: 'Foo' }, { message: 'Bar' }])
return { items }
}
}
</script>
1๐
In HelloWorld.vue, your script block should be like
<script setup>
import { ref } from 'vue'
export const items = ref([{ message: 'Foo' }, { message: 'Bar' }])
</script>
๐คAmaarockz
1๐
As you are using <script setup>
syntax, you only need this code to make it works:
<script setup>
import { ref } from 'vue'
const items = ref([{ message: 'Foo' }, { message: 'Bar' }])
</script>
No data or return statements are required
๐คAndres Foronda
Source:stackexchange.com