加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

从bootstrap应用css类时的PrimeNG日历错误

发布时间:2020-12-18 00:26:57 所属栏目:安全 来源:网络整理
导读:我有这个奇怪的错误,我使用PrimeNG在我的应用程序中显示DatePicker.当我尝试使用bootstrap的表单控件时,我遇到了一个可视错误. 这是我的模板: div class="form-group row" div class="form-group col-md-2" label for="valeur"Valeur/label input type="num
我有这个奇怪的错误,我使用PrimeNG在我的应用程序中显示DatePicker.当我尝试使用bootstrap的表单控件时,我遇到了一个可视错误.

这是我的模板:

<div class="form-group row">
    <div class="form-group col-md-2">
        <label for="valeur">Valeur</label>
        <input type="number" id="valeur" class="form-control" />
    </div>

    <div class="form-group col-md-5">
        <label for="dateDebut">Date de début</label>
        <p-calendar id="dateDebut" dateFormat="dd/mm/yy" styleClass="form-control" [showIcon]="true"></p-calendar>
    </div>

    <div class="form-group col-md-5">
        <label for="dateFin">Date de fin</label>
        <p-calendar id="dateFin" dateFormat="dd/mm/yy" styleClass="form-control" [showIcon]="true"></p-calendar>
    </div>
</div>

这是结果:

编辑

如果它有任何帮助,这里是生成的HTML:

<div class="form-group col-md-5" _ngcontent-scp-1="">
   <label for="dateDebut" _ngcontent-scp-1="">Date de début</label>
   <p-calendar ng-reflect-show-icon="true" ng-reflect-date-format="dd/mm/yy" ng-reflect-style-class="form-control" styleclass="form-control" id="dateDebut" dateformat="dd/mm/yy" _ngcontent-scp-1="">
      <!--template bindings={
         "ng-reflect-ng-if": "true"
         }-->
      <span ng-reflect-initial-classes="form-control" class="form-control ui-calendar" ng-reflect-raw-class="ui-calendar">
         <input id="dp1467976345328" ng-reflect-value="" class="hasDatepicker ui-inputtext ui-widget ui-state-default ui-corner-left" ng-reflect-raw-class="[object Object]" type="text"><!--template bindings={
            "ng-reflect-ng-if": "true"
            }--><button ng-reflect-icon="fa-calendar" type="button" pbutton="" class="ui-datepicker-trigger ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only"><span class="ui-button-icon-left ui-c fa fa-fw fa-calendar"></span><span class="ui-button-text ui-c">ui-button</span></button>
      </span>
      <!--template bindings={
         "ng-reflect-ng-if": "false"
         }-->
   </p-calendar>
</div>

解决方法

我已经使用了下面的解决方法,这在IE和IE中都运行良好.铬:
<p-calendar [inputStyle]="{'width':'55%'}" ...

试试吧

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读