You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,9 @@ List of 300 VueJS Interview Questions
174
174
|165|[How do you perform asynchronous operations?](#how-do-you-perform-asynchronous-operations)|
175
175
|166|[What are differences between mutations and actions?](#what-are-differences-between-mutations-and-actions)|
176
176
|167|[Give an example usage of actions?](#give-an-example-usage-of-actions?)|
177
+
|168|[How do you dispatch actions?](#how-do-you-dispatch-actions)|
178
+
|169|[Can you dispatch an action using payload or object?](#can-you-dispatch-an-action-using-payload-or-object)|
179
+
|170|[Can I use styled components in vuejs?](#can-i-use-styled-components-in-vuejs)|
177
180
178
181
1.### What is VueJS?
179
182
**Vue.js** is an open-source, progressive Javascript framework for building user interfaces that aim to be incrementally adoptable. The core library of VueJS is focused on the `view layer` only, and is easy to pick up and integrate with other libraries or existing projects.
@@ -3040,4 +3043,25 @@ List of 300 VueJS Interview Questions
3040
3043
}
3041
3044
}
3042
3045
})
3043
-
```
3046
+
```
3047
+
168. ### How do you dispatch actions?
3048
+
Actions are simply triggered with the store.dispatch method as below,
3049
+
```javascript
3050
+
store.dispatch('increment')
3051
+
```
3052
+
169. ### Can you dispatch an action using payload or object style?
3053
+
Yes, actions support both payload and object style format similar to mutations.
3054
+
```javascript
3055
+
// dispatch with a payload
3056
+
store.dispatch('incrementAsync', {
3057
+
amount:10
3058
+
})
3059
+
3060
+
// dispatch with an object
3061
+
store.dispatch({
3062
+
type:'incrementAsync',
3063
+
amount:10
3064
+
})
3065
+
```
3066
+
170. ### Can I use styled components in vuejs?
3067
+
Styled components is basically used for ReactJS applications. If you want to use for VueJS applications, there is vuejs styled components library available under styled component library. VueJS Styled component is a javascript library for stying vuejs applications.
0 commit comments