This article mainly introduces the ionic custom pop-up effect, which is very good and has reference value. Friends who need it can refer to it
Customized pop-ups are often needed during the work process. Therefore, the content is organized as follows to facilitate learning. If there is anything inappropriate, please correct me!
Ideas
Use the pop-up box $ionicPopup that comes with ionic.
Hide the head and tail and keep only the body part
Use templateUrl or template to introduce the required template
Code
$ionicPopup.show({ cssClass:'team-popup', template: "<p class='list popup-form'>" + "<p class = 'form-title'>{{tempItem.name}}</p>" + "<p class='form-content'>" + "<p class='input-name'>input1:</p>" + "<p class='input-area'><input type='number' placeholder='10.00' ng-model='tempItem.input1'></p>" + "</p>" + "<p class='form-content'>" + "<p class='input-name'>input2:</p>" + "<p class='input-area'><input type='number' ng-model='tempItem.input2'></p>" + "</p>" + "<p class='form-button'>" + "<button class='button wyl-left-button' ng-click='fnClosePopup()' >cancel</button>" + "<button class='button wyl-right-button' ng-click='fnExchangeGoods()' >submit</button>" + "</p>" + "</p>", scope: $scope });
/**弹出窗popup 无titlecss*/ .team-popup .popup-head{ display: none; } .team-popup .popup{ padding: 0; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px; } .team-popup .popup-body{ padding: 0; /*overflow-y:scroll;*/ } /*自定义表单*/ .popup-form{ font-size:15px } .form-title{ margin: 10px; text-align:center } .form-content{ width: 90%; height: 36px; background-color: white; padding-left: 10px; margin:10px auto; position: relative; border-radius: 5px; } .form-content input{ line-height: 36px; padding-left:10px } .input-name{ float: left; line-height: 36px; } .input-area{ width: 50%; float: left; height: 36px; } .form-button{ width: 90%; height: 36px; margin:10px auto; position: relative; } .form-button button{ width: 50%; border-radius: 5px; min-height: 10px; height: 100%; line-height: 100%; }
Effect
The above is the detailed content of Detailed explanation of ionic custom pop-up box examples. For more information, please follow other related articles on the PHP Chinese website!