Skip to content

Wrapped array value dont work correctly  #53

Closed
@KoreSamuel

Description

@KoreSamuel

codesandbox here

versions: "vue-function-api": "^2.1.1"

<script lang="ts">
import { createComponent, value, Wrapper } from "vue-function-api";

export default createComponent({
  setup(props, context) {

    const tabs: Wrapper<string[]> = value(["tab2"]);
    tabs.value.push("tab3"); // ['tab2', 'tab3']

    // should ['tab1', 'tab2', 'tab3'] but ['tab2', 'tab2', 'tab3']
    tabs.value.unshift("tab1");

    // worked correctly
    const tabs2: string[] = ["tab2"];

    tabs2.push("tab3");

    // ['tab1', 'tab2', 'tab3']
    tabs2.unshift("tab1");

    return {
      tabs,
      tabs2
    };
  }
});
</script>

by the way, version 2.0.6 worked fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions