我正在使用vue js 2.5.16。 Mozilla,Chrome浏览器运行正常,但Safari浏览器运行不正常。
我的环境:
vue js:2.5.16
移动设备:iPhone 5S(系统版本:IOS(9.2))
移动浏览器:Safari
显示此代码
UISegmentedControl
我的完整代码:
ar.
each_with_object({}) do |hash, acc|
(acc[hash["CustID"]] ||= {"Customer" => hash["CustID"], "TotalSales" => 0}).
tap { |h| h["TotalSales"] += hash["Sales"].to_f }
end.
values.
sort_by { |h| -h["TotalSales"] }.
map.
with_index(1) { |h, idx| h.merge("Rank" => idx) }
#⇒ [{"Customer"=>"Cust06", "TotalSales"=>2266.2925, "Rank"=>1},
# {"Customer"=>"Cust07", "TotalSales"=>2149.02, "Rank"=>2},
# {"Customer"=>"Cust08", "TotalSales"=>114.90699999999998, "Rank"=>3},
# {"Customer"=>"Cust04", "TotalSales"=>110.774, "Rank"=>4},
# {"Customer"=>"Cust09", "TotalSales"=>24.105, "Rank"=>5},
# {"Customer"=>"Cust02", "TotalSales"=>15.24, "Rank"=>6}]
PS:
我已经介绍了babel-polyfill和es6-promise,但是它仍然不起作用!任何人都遇到过相同的问题,或者可以帮助解释一下吗? 谢谢