1👍
✅
The problem is that when you run a for loop and assign name
, it’s a number and not a string.
:name="index+1" <---- This is a number
But, activeName
is a string. So, the values don’t match and that’s why the accordian does not open on page load.
Here’s an updated sandbox: https://codesandbox.io/s/vue-template-ysm79
I changed activeName
to a number. The for loop accordian will now open and the normal HTML accordians won’t.
Source:stackexchange.com