Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped array value dont work correctly #53

Closed
KoreSamuel opened this issue Aug 9, 2019 · 0 comments
Closed

Wrapped array value dont work correctly #53

KoreSamuel opened this issue Aug 9, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@KoreSamuel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants