TW-Elements
TW-Elements copied to clipboard
Doesn't work when upgrading from v1.0.0-beta1 to v1.0.0-beta2 in Vue
Today after reinstalling node_modules I found that my tailwind elements are not working. After spending a lot of time I found out that the tailwind element version has changed. The document was different from before. I changed according to new document but it also not working. The previous code in the file App.vue It worked fine before:
<script>
import { onMounted } from "vue";
export default {
setup() {
onMounted(() => {
const importTE = async () => {
await import("tw-elements");
};
importTE();
});
},
};
</script>
After the change:
<script>
import { onMounted } from "vue";
import { Collapse, Dropdown, initTE } from "tw-elements";
export default {
setup() {
onMounted(() => {
initTE({ Collapse, Dropdown });
});
},
};
</script>
But it doesn't work? Hope anyone can help, thanks!
for my situation,it works
onMounted(() => {
setTimeout(() => {
initTE({ Carousel,Datepicker, Input,Dropdown });
}, 1000);
})
@iamyjx thank you! it worked, but why doesn't the documentation mention this, and they designed it to be backwards compatible with the old version. Luckily there are still people like you!!!!
What bundler are you using with Vue? Is that default Vue CLI or something else?
@Trochonovitz Yes, it is default Vue CLI