Vue.js Vue和Fullcalendar自定义日单元格
我需要在每日单元格中添加一个按钮。我知道我可以做类似的事情:Vue.js Vue和Fullcalendar自定义日单元格,vue.js,fullcalendar,Vue.js,Fullcalendar,我需要在每日单元格中添加一个按钮。我知道我可以做类似的事情: dayCellContent: { html: `<button> button text </button>`, }, daycell内容:{ html:`button text`, }, 但我真的不想这么做,我更愿意使用我的按钮组件。同样像这样,我将不得不添加没有Vue的点击监听器,我也不太喜欢 那么,有没有更好的方法?最好只传入Vue组件?我通过使用一个组件并使用Vue构造函数初始化它来解决这个问
dayCellContent: {
html: `<button> button text </button>`,
},
daycell内容:{
html:`button text`,
},
但我真的不想这么做,我更愿意使用我的按钮组件。同样像这样,我将不得不添加没有Vue的点击监听器,我也不太喜欢
那么,有没有更好的方法?最好只传入Vue组件?我通过使用一个组件并使用Vue构造函数初始化它来解决这个问题,就像这样
const el = document.createElement("a");
const calendarDayCellContentContainer = new Vue({
el,
render: (h) =>
h(CalendarDayCellContent, {
props: {
buttonText: "whatever",
},
}),
});
并传递按钮。$el作为DOM节点
domNodes: [button.$el],