简体   繁体   English

vue-bootstrap-datetimepicker 中缺少指向下个月和上个月的箭头?

[英]arrows to next and previous month are missing in vue-bootstrap-datetimepicker?

I'm using this date picker which is working fine but appears to be missing some CSS.我正在使用这个工作正常但似乎缺少一些 CSS 的日期选择器 I have tried tons of suggestions to make this css work but with no luck.我已经尝试了很多建议来使这个 css 工作但没有运气。 This is my current (relevant) code:这是我当前的(相关)代码:

<template>
    <div class="row">
        <div class="col-lg-4">
            <div class="input-group">
                <date-picker
                        name="start-date"
                        ref="startDate">
                </date-picker>
                <div class="input-group-prepend">
                    <button class="btn btn-outline-primary" type="button" @click="$refs.startDate.dp.show()">
                        <font-awesome-icon icon="calendar-alt"></font-awesome-icon>
                    </button>
                </div>
            </div>
        </div>

        <div class="col-lg-4">
            <div class="input-group">
                <date-picker
                        name="end-date"
                        ref="endDate">
                </date-picker>
                <div class="input-group-prepend">
                    <button class="btn btn-outline-primary" type="button" @click="$refs.endDate.dp.show()">
                        <font-awesome-icon icon="calendar-alt"></font-awesome-icon>
                    </button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>

    import datePicker from 'vue-bootstrap-datetimepicker';
    // Import date picker css
    import 'pc-bootstrap4-datetimepicker/build/css/bootstrap-datetimepicker.css';


    export default {
        name: "DateRange",
        components: {
            myDatePicker,
        },
        date: {
            startDate: '2019-10-10',
            endDate:   '2019-09-09'
        }
    }
</script>

And this is how my datepicker looks like:这就是我的日期选择器的样子:

在此处输入图像描述

The arrows to the next/previous month are not visible but they are working fine.下个月/上个月的箭头不可见,但工作正常。 They should be visible as many of the examples the library shows .它们应该与库显示的许多示例一样可见。 I checked inspect element and they were not overwritten by another object or anything.我检查了检查元素,它们没有被另一个 object 或任何东西覆盖。 No warnings or errors are found.未发现警告或错误。 I'm truly out of ideas after having tried all the suggestions all the other questions here on SO suggest.在尝试了所有关于 SO 建议的所有其他问题后,我真的没有想法。 Is there any way to get them to show up or if not maybe a custom arrows CSS but would prefer not going down that road.有什么方法可以让它们出现,或者如果不是自定义箭头 CSS 但不想走那条路。

You can add the following to your after the <script> tag and this will make custom CSS:您可以在<script>标记之后添加以下内容,这将生成自定义 CSS:

<style>
    i.custom-button-previous:before {
        content: "<<";
    }

    i.custom-button-next:before {
        content: ">>";
    }
</style>

This will put arrows of the given shape inside content in those two places where the arrows are missing这会将给定形状的箭头放在缺少箭头的那两个地方的内容中

In the documentation, I found that bootstrap css is needed to run this picker.在文档中,我发现运行此选择器需要引导 css。

在此处输入图像描述

I can't see bootstrap import in your code provided above which should be something like:我在上面提供的代码中看不到引导导入,应该类似于:

import 'bootstrap/dist/css/bootstrap.css';导入'bootstrap/dist/css/bootstrap.css';

Please try to import this or update the question.请尝试导入此问题或更新问题。

The date picker uses glyphicons icons for the arrows.日期选择器使用字形图标作为箭头。 Can you check if you have "glyphicons-halflings-regular.woff" file getting imported in your website, if not include below css你能检查一下你的网站是否有“glyphicons-halflings-regular.woff”文件被导入,如果没有包括在 css 下面

@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/fonts/glyphicons-halflings-regular.woff'), url('http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/fonts/glyphicons-halflings-regular.woff') format('woff');}
}

Add this, It works for me.添加这个,它对我有用。

<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过更改宽度并在其中插入图标来设置 vue-bootstrap-datetimepicker 的样式? - How to style vue-bootstrap-datetimepicker by changing the width and inserting icons in it? smalot / bootstrap-datetimepicker导航箭头丢失 - smalot/bootstrap-datetimepicker navigation arrows missing 停止自动输入下个月/上个月日期时间选择器 - Stop Automatic Entry Next / Previous Month Datetimepicker Bootstrap datetimepicker显示下个月的一周 - Bootstrap datetimepicker shows week from next month 如何在日期选择器中显示下一个和上一个月的名称,而不只是箭头&lt;,&gt; - How to show next and previous month names in datepicker instead of just arrows <,> 引导幻灯片显示上一个和下一个按钮/箭头未显示在中间 - Bootstrap slideshow previous and next buttons/ arrows not showing in the middle 如何在Bootstrap日期选择器中获得下个月上个月而不是下一个上一个图标? - How to get next month Previous month in Bootstrap date picker instead of next previous icon? 日期选择器缺少引导导航箭头 - Bootstrap navigation arrows missing for datepicker jQueryUI 日期选择器不显示下一个前一个三角形箭头 - jQueryUI datepicker not showing next previous triangle arrows 如何为图库添加上一个和下一个箭头? - How to add previous and next arrows for image gallery ?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM