美文网首页
Vuex 相关试题

Vuex 相关试题

作者: 安北分享 | 来源:发表于2021-08-31 13:51 被阅读0次

1.[判断题]模块化vuex,可以让每一个模块拥有自己的state、mutation、action、gettersm吗?

×
正确答案: √ 
2.[多选题]vuex有哪几种属性vuex有哪几种属性vuex有哪几种属性 (10分)

A.state
B.getters
C.mutations
D.Actions
E.Modules
正确答案: ABCDE

3.[多选题]如何在组件中分发action (10分)

A.this.store.dispatch('increment') B.this.store.commit('increment')
C....mapActions(['increment']),
D.this.$store.dispatch({type: 'increment',amount: 10})

正确答案: 
ACD
4.什么时候用vuex? (10分)

A.多个组件依赖于同一状态时
B.父子组件传值时
C.来自不同组件的行为需要变更同一状态。
D.单页面数据处理时

正确答案: 
AC
5.[多选题]如何访问state (10分)

this.store.state.count ...mapState(['count']) this.store.commit('count')
this.$store.dispatch('count')

正确答案: 
AB
6.[多选题]提交mutations的方式有 (10分)

store.commit('increment',10)
this.$store.commit('increment',10)
this.store.commit('increme',10)
store.commit({type:'increment',10})

正确答案: 
AD
7.[单选题]请求代码应该写在vuex的哪个属性中? (10分)

state
getters
mutations
actions

正确答案: 
D

8.[单选题]如何从组件的方法提交一个变更? (10分)

store.commit('increment')
this.store.commit('increment')store.commit('increment')
this.store.commit('increment')

正确答案: 
B
9.[单选题]vuex中状态储存在哪里 (10分)

state
getters
mutations
Actions

正确答案: 
A
10.[单选题]更改 vuex 的 store 中的状态的唯一方法是? (10分)

mutations
actions
正确答案: 
B

相关文章

  • Vuex 相关试题

    1.[判断题]模块化vuex,可以让每一个模块拥有自己的state、mutation、action、getters...

  • vuex+axios 的开发流程记录

    相关文档 vuex: https://vuex.vuejs.org/zh/ 是否有必要使用vuex vuex是vu...

  • iOS面试进阶篇(二)

    目录 UITableViewCell相关试题多线程相关试题进程与线程相关试题网络相关试题TCP与UDPTCP连接的...

  • vuex相关

    1. 从vuex中取的数据,不能直接更改,单向数据流 需要浅拷贝对象之后更改,否则报错; 2. vuex中的数据在...

  • Vue组件通讯

    面试题,比较简单的是 props,$emit Vuex(Vuex用来传值被认为与其“数据共享”的定位不太一样) $...

  • 使用electron实现百度网盘悬浮窗口功能的示例代码

    相关依赖 里面使用了vuex vue vue-route storeJs storeJs 用来持久化vuex状态 ...

  • Vuex状态管理模式的面试题及答案

    Vuex状态管理模式的面试题及答案 1、vuex有哪几种属性? 答:有五种,分别是 State、 Getter、M...

  • 如何更丝滑的使用Vuex

    vuex-cuer 简介 还在为 vuex 的魔法字符串而烦恼?还在为阅读项目里 vuex 相关的代码而头痛?如何...

  • uniapp 中 vuex调试

    uniapp中内置了vuex依赖,在微信小程序中为了更方便的调试vuex相关数据,使用vuex中的createLo...

  • vuex相关笔记

    一个模块中的配置 将各个模块引入集中 如何调取state 如何引入getters

网友评论

      本文标题:Vuex 相关试题

      本文链接:https://www.haomeiwen.com/subject/qqmyiltx.html