I need to rewrite This code
export default Vue.extend<Props>({ functional: true, render(h, { props, slots, data }) { const { href, external, target, type, button } = props; const slot = slots().default; console.log(data); ....
To Vue 3 combination script settings, So I managed to get
<script setup lang="ts"> import {h, useSlots} from 'vue'; const props = defineProps<Props>(); const slots = useSlots(); ...
But how do I get the data? Start with this part -> render(h, { props, slot, data }) {
The data should contain domProps if there is such..etc
console.log(data);
{ { attrs: { target: '_self', href: 'https://example.com', button: true }, class: [ 'X-button', { 'X-button--': false, 'X-button--size-auto': true } ] }
Thanks in advance
If you still need this,
useSlots().default()
Returns slot data, including DOM attributes.