2

No puedo hacer un salto de línea en JavaScript, el \n y la etiqueta <br /> no me funcionan. Que otra forma hay para realizar salto de linea de linea específicamente en el eventRender.

Gracias.

Este es mi código.

let calendarEl = document.getElementById('calendar');
                this.calendar = new Calendar(calendarEl, {
                    plugins: [interactionPlugin, dayGridPlugin, timeGridPlugin],
                    locale: esLocale,
                    defaultView: 'dayGridMonth',
                    timeZone: 'UTC',
                    header: {
                        left: 'prev,next today myCustomButton',
                        center: 'title',
                        right: 'dayGridMonth'
                    },
                    events: this.events,
                    eventRender: function (info) {
                        $(info.el).popover({
                            title: info.event.title,
                            placement:'top',
                            trigger : 'hover',
                            content: info.event.extendedProps.content+'<br />'+info.event.extendedProps.description,
                            container:'body'
                        }).popover('show');
                    }
                });
                this.calendar.render();

1 respuesta 1

4

Si deseas hacer un salto de linea puedes hacerlo a través del código html con el tag < /br > pero debes activar la opción html con html: true:

Ejemplo:

$(info.el).popover({
                            title: info.event.title,
                            placement:'top',
                            trigger : 'hover',
                            html: true, /* activamos el uso de codigo html */
                            content: info.event.extendedProps.content+'<br />'+info.event.extendedProps.description,
                            container:'body'
                        }).popover('show');

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.