Skip to content

useRoute() is not reactive #2

Closed
@ModyQyW

Description

@ModyQyW

Repo

Live Demo

npm i -g pnpm
pnpm install
pnpm run dev
  • Should See route.query: {} at first.
  • Step 1: Click toQuery button. Should see route.query: { "a": "1" }.
  • Step 2: Click useQuery2 button. Should see route.query: { "a": "2" }, but actually see route.query: { "a": "1" }.
  • Step 3: Click useQuery1 button. Should see route.query: { "a": "1" }.

Why I see route.query: { "a": "1" } in Step 2? I did something wrong? Any suggestions? :D

  • 一开始应该会看到 route.query: {}
  • 步骤 1:点击 toQuery 按钮。应该会看到 route.query: { "a": "1" }
  • 步骤 2:点击 useQuery2 按钮。应该会看到 route.query: { "a": "2" },但实际上看到 route.query: { "a": "1" }
  • 步骤 3:点击 useQuery1 按钮。应该会看到 route.query: { "a": "1" }

为什么我在步骤 2 会看到 route.query: { "a": "1" }?我写错哪里了吗?有什么建议吗?:D

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions