vue-ctk-date-time-picker
vue-ctk-date-time-picker copied to clipboard
Fixes id equals to undefined string
-
Per README.md id is optional and defaults to undefined [1]. This causes a weird behaviour of string concatenation of undefined and results id's in the format similar to 'undefined-...'.
Specifically:
undefined-wrapperundefined-inputundefined-picker-containerundefined-picker-container-DatePicker
-
When using multiple datepicker components on a html page this results in an invalid html because of duplicate
ids.
[1] https://github.com/chronotruck/vue-ctk-date-time-picker#props-api
Does this solve this:
Cannot read property 'id' of undefined
id: "".concat(_ctx.$attrs.id, "-wrapper"),
@romulous75
I do not really remember this well, but from the description I wrote there back then in 2020 this is not. It's for fixing the issue of creating duplicate id's when we do not define an id.
The error you are mentioning seems to indicate that $attrs is undefined. But I still reference $attrs in my code. You could try to do some debugging in the browser about _ctx.