优艾设计网

js这一坨代码有没有办法简化下,看着挺尴尬的?

优艾设计网 https://www.uibq.com 2023-04-17 10:46 出处:网络 作者:磨皮美容教程
$scope.ezzh_qsw_lines = Math.ceil($scope.ezzh_qsw.length / $scope.cols); $scope.ezzh_zsw_lines = Math.ceil($scope.ezzh_zsw.length / $scope.cols); $scope.ezzh_hsw_lines = Math.ceil($scope.ezzh_hsw.leng

$scope.ezzh_qsw_lines = Math.ceil($scope.ezzh_qsw.length / $scope.cols); $scope.ezzh_zsw_lines = Math.ceil($scope.ezzh_zsw.length / $scope.cols); $scope.ezzh_hsw_lines = Math.ceil($scope.ezzh_hsw.length / $scope.cols); $scope.bsdw_qsw_lines = Math.ceil($scope.bsdw_qsw.length / $scope.cols); $scope.bsdw_zsw_lines = Math.ceil($scope.bsdw_zsw.length / $scope.cols); $scope.bsdw_hsw_lines = Math.ceil($scope.bsdw_hsw.length / $scope.cols); $scope.bgdw_qsw_lines = Math.ceil($scope.bgdw_qsw.length / $scope.cols); $scope.bgdw_zsw_lines = Math.ceil($scope.bgdw_zsw.length / $scope.cols); $scope.bgdw_hsw_lines = Math.ceil($scope.bgdw_hsw.length / $scope.cols); $scope.sgdw_qsw_lines = Math.ceil($scope.sgdw_qsw.length / $scope.cols); $scope.sgdw_zsw_lines = Math.ceil($scope.sgdw_zsw.length / $scope.cols); $scope.sgdw_hsw_lines = Math.ceil($scope.sgdw_hsw.length / $scope.cols); $scope.bghs_qsw_lines = Math.ceil($scope.bghs_qsw.length / $scope.cols); $scope.bghs_zsw_lines = Math.ceil($scope.bghs_zsw.length / $scope.cols); $scope.bghs_hsw_lines = Math.ceil($scope.bghs_hsw.length / $scope.cols); $sc优艾设计网_PS交流ope.sghs_qsw_lines = Math.ceil($scope.sghs_qsw.length / $scope.cols); $scope.sghs_zsw_lines = Math.ceil($scope.sghs_zsw.length / $scope.cols); $scope.sghs_hsw_lines = Math.ceil($scope.sghs_hsw.length / $scope.cols);


浣味 2022-06-16 17:43

优艾设计网_Photoshop交流

以上


流浪人生_2020 2022-06-16 17:51

优艾设计网_Photoshop论坛

重复的代码都是可以消除的,要写好代码,就是消除重复和提高表达力


一直是光明的 2022-06-16 17:53

$scope.ezzh_zsw_lines把.后的名字放在数组里循环获取,这样只优艾设计网_Photoshop问答需要写一个Math.ceil了


lamjohn 2022-06-16 17:54

优艾设计网_PS问答

思路大概是这样子:


0

精彩评论

暂无评论...
验证码 换一张
取 消