How to pass an array within a query string?

前端 未结 10 1339
一整个雨季
一整个雨季 2020-11-22 02:35

Is there a standard way of passing an array through a query string?

To be clear, I have a query string with multiple values, one of which would be an array value.

10条回答
  •  既然无缘
    2020-11-22 02:45

    This works for me:

    In link, to attribute has value:

    to="/filter/arr?fruits=apple&fruits=banana"
    

    Route can handle this:

    path="/filter/:arr"
    

    For Multiple arrays:

    to="filter/arr?fruits=apple&fruits=banana&vegetables=potato&vegetables=onion"
    

    Route stays same.

    SCREENSHOT

提交回复
热议问题