一、state 优化前: 优化后: ... 表示展开运算符,mapState表示把Vuex里面的数据映射到computed,把city公用数据映射到city的计算属性之中 也可以另起名字: 二、mutations