routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// Composables
|
||||
import { makeComponentProps } from "../composables/component.js"; // Utilities
|
||||
import { camelize, capitalize, h } from 'vue';
|
||||
import { genericComponent } from "./defineComponent.js";
|
||||
export function createSimpleFunctional(klass, tag = 'div', name) {
|
||||
return genericComponent()({
|
||||
name: name ?? capitalize(camelize(klass.replace(/__/g, '-'))),
|
||||
props: {
|
||||
tag: {
|
||||
type: String,
|
||||
default: tag
|
||||
},
|
||||
...makeComponentProps()
|
||||
},
|
||||
setup(props, {
|
||||
slots
|
||||
}) {
|
||||
return () => {
|
||||
return h(props.tag, {
|
||||
class: [klass, props.class],
|
||||
style: props.style
|
||||
}, slots.default?.());
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=createSimpleFunctional.js.map
|
||||
Reference in New Issue
Block a user