state:
等同于this,
mutations:
1,存放方法,是同步的,
2,里面的函数只接收两个参数
所以要将数据存放到对象里面,(state,{ID,name})
commit:
1,没有返回值
computed
1,在 TS 里使用 computed 要用 getter 语法
2,数据不管是对象和值都要放在这里,当值变化时对这些数据进行监听,保证数据的及时和灵活
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!