Comments (2)
Upd: changed to this code:
// ccEmails.$patch((state) => {
// state.all.push('')
// })
ccEmails.all.push('')
ccEmails.all = [...ccEmails.all]
but it still return error. It seems I cannot modify state at all????. I also did next:
// Store file
...
return defineStore(id, () => {
const all = ref(null)
return { all }
})
...
ccEmails.all = [123]
doesn't work.
. Btw. If I call second time function to change state it returns "Cannot read properties of null (reading 'style')". (were insertBefore instead of style)
wtf?
I want notice that even on production of course it changes value of state if output it directly to {{ state }} in template, but doesn't change anything when I have div v-for which loops this state
from pinia.
When I fully deleted $patch function from my component and also changed to this code:
// ccEmails.$patch((state) => {
// state.all.push('')
// })
ccEmails.all.push('')
ccEmails.all = [...ccEmails.all]
I am getting another error:
5
entry.ecbe6a09.js:1 TypeError: Cannot read properties of null (reading 'push')
at g (ModalEmailSend.c23444bd.js:1:2923)
at l.length.o.onClick.e.<computed>.e.<computed> (ModalEmailSend.c23444bd.js:1:3797)
at Mo (entry.ecbe6a09.js:1:13641)
at wa (entry.ecbe6a09.js:1:13720)
at HTMLButtonElement.n (entry.ecbe6a09.js:1:75130)
l4 @ entry.ecbe6a09.js:1
// (ModalEmailSend.c23444bd.js:1:2923)
/// ...
function O(c) {
b.attachFiles.splice(c, 1)
}
const _ = Q()
, i = X()
, p = Y();
function g(c) {
c == "cc" && i.all.push("") // <------
}
// ....
so i cannot work with arrays.?
from pinia.
Related Issues (20)
- error TS2536: Type 'key' cannot be used to index type 'Store<string, S, G, {}>
- Cant create an async store HOT 2
- Ability to manually trigger plugin action subscriptions within a setup store HOT 1
- acceptHMRUpdate skips optional attributes without default values HOT 3
- Pinia Eslint plugin HOT 9
- Typings for refs seem to be wrong in setup store HOT 3
- TS(7022): implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer HOT 1
- Using Pinia app crashes with Error: The requested module 'vue-demi' does not provide an export named 'hasInjectionContext'
- The inferred type of 'default' cannot be named without a reference to '.pnpm/[email protected][email protected][email protected]/node_modules/pinia'. This is likely not portable. A type annotation is necessary.ts(2742) HOT 1
- Computed does not work in nested store
- In Pinia, the `watch` function fails to capture changes to object properties within the `state`.
- Composition API documentation HOT 1
- mapActions does not work with parameters HOT 1
- Return type of storeToRefs doesn't match runtime result if values are nested computed values HOT 1
- Composing Store lose typescript type HOT 1
- pinia doesn't show state properly when useAsyncState has been used
- Nuxt3 useRoute update HOT 1
- current use vscode vue3.2+pinia project, Mouse click can not jump HOT 1
- Pinia stores imported from npm packages are not reactive or don't share the same context
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinia.