---
title: "Discussion on \"Pinia: 在Vue元件以外安全地使用pinia\" | Hashnode"
description: "Discussion on \"Pinia: 在Vue元件以外安全地使用pinia\". 最近才發現Pinia跟React全域狀態管理的使用方式不一樣，有個很方便的特性是，如果要在Vue元件以外使用，只要pinia store是在 app.use(pinia) 後呼叫即可使用，其中更能確保pinia store被呼叫的方式是──在函式(function)內使用：\n\nThe easiest way to ensure this is always applied is to defer"
url: "https://hashnode.com/posts/pinia-vue-pinia/699e5d510daf99859e63cb75"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Pinia: 在Vue元件以外安全地使用pinia](https://urlun0404.hashnode.dev/pinia-vue-pinia?utm_source=hashnode&utm_medium=feed)

最近才發現Pinia跟React全域狀態管理的使用方式不一樣，有個很方便的特性是，如果要在Vue元件以外使用，只要pinia store是在 app.use(pinia) 後呼叫即可使用，其中更能確保pinia store被呼叫的方式是──在函式(function)內使用： The easiest way to ensure this is always applied is to defer

Feb 25 · 1 min read · urlun0404.hashnode.dev  
Read the article

-   [#vuejs](https://hashnode.com/tag/vuejs)
-   [#pinia](https://hashnode.com/tag/pinia)

## Written by

[You-Lun Lin](https://hashnode.com/@urlun0404)

@urlun0404 · New Taipei, Taiwan

  
[View profile](https://hashnode.com/@urlun0404)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
