方法1:旁路路線參數 您可以定義一個getter函數來選擇給定的Blogtext。將blog-route的:id作為param傳遞,以便您可以將其用作getter中的過濾器。然后在該getter中定義一個簡單的過濾器邏輯。我使用了forEach,但是還有其他選項可以過濾數組,選擇一個適合您需要的。 在component中,您可以映射getter,并使用通過路由傳遞的id在計算屬性中調用它,瞧,它應該返回特定博客文章的文本。 VueX Store import { createStore } from 'vuex';export default createStore({ state: { cards: [{ title: "Blog 1", text: "This is blog 1", index: 1, }, { title: "Blog 2", text: "This is blog 2", index: 2, }, { title: "Blog 3", text: "This is blog 3", index: 3, }, { title: "Blog 4", text: "This is blog 4", index: 4, }, { title: "Blog 5", text: "This is blog 5", index: 5, }, { title: "Blog