Ionic:如何改变 $ionicPopup 的宽度?
Ionic: How is it possible to change the width of $ionicPopup?
我正在尝试更改 $ionicPopup 的宽度;我尝试使用以下 css 代码将其导入 cssClass: my-popup
:
.my-popup {
width: 400;
}
但这似乎没有用。
我真的卡在那里了,目前找不到解决办法。
任何帮助将不胜感激。谢谢。
将以下内容放入 src/theme/variables.scss 文件;
$popover-ios-width: 300px;
其实很简单,看下面的例子:
var pinPopup = $ionicPopup.show({
templateUrl : 'app/user-profile/user-pin.html',
title: '4-digit Security PIN',
scope : $scope,
cssClass: 'my-popup',
buttons : [
{
text : 'Cancel',
},
{
text : '<b>Save</b>',
type: 'button-positive',
onTap : function(e) {
var val = document.getElementById('pin-output').value;
$scope.userRow.password = val;
}
}
]
})
现在在你的 CSS 中简单地做:
.my-popup .popup {
width: 400px;
}
我正在尝试更改 $ionicPopup 的宽度;我尝试使用以下 css 代码将其导入 cssClass: my-popup
:
.my-popup {
width: 400;
}
但这似乎没有用。
我真的卡在那里了,目前找不到解决办法。
任何帮助将不胜感激。谢谢。
将以下内容放入 src/theme/variables.scss 文件;
$popover-ios-width: 300px;
其实很简单,看下面的例子:
var pinPopup = $ionicPopup.show({
templateUrl : 'app/user-profile/user-pin.html',
title: '4-digit Security PIN',
scope : $scope,
cssClass: 'my-popup',
buttons : [
{
text : 'Cancel',
},
{
text : '<b>Save</b>',
type: 'button-positive',
onTap : function(e) {
var val = document.getElementById('pin-output').value;
$scope.userRow.password = val;
}
}
]
})
现在在你的 CSS 中简单地做:
.my-popup .popup {
width: 400px;
}