I am looking in the setup function to render an array of buttons. For simplicity purposes I have provided this example below.
When I use an array and push or assign values as default, then place the array with in the render function I do not see any reactivity on click.
setup(props, {emit, slots}) {
const base_number = ref(1)
const base_offset= computed(()=> { return base.value + 2 })
let buttons = [base_offset.value]
let pageClick = (event , pageNumber ) => {
base_number.value = 3
}
return h("ul",{ class: "pagination", 'onClick' : event => { pageClick(event, 1)}},
buttons
)
However when I place the array of components like so in the return , reactivity and value updating works.
//On click will update base_offset
return h("ul",{ class: "pagination", 'onClick' : event => { pageClick(event, 1)}},
[base_offset.value]
)
}
What am I missing and is it possible to pass in a array of vnodes?