routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
// Utilities
|
||||
import { computed, isRef } from 'vue';
|
||||
import { getCurrentInstanceName, propsFactory } from "../util/index.js"; // Types
|
||||
// Composables
|
||||
export const makeRoundedProps = propsFactory({
|
||||
rounded: {
|
||||
type: [Boolean, Number, String],
|
||||
default: undefined
|
||||
},
|
||||
tile: Boolean
|
||||
}, 'rounded');
|
||||
export function useRounded(props, name = getCurrentInstanceName()) {
|
||||
const roundedClasses = computed(() => {
|
||||
const rounded = isRef(props) ? props.value : props.rounded;
|
||||
const tile = isRef(props) ? false : props.tile;
|
||||
const classes = [];
|
||||
if (tile || rounded === false) {
|
||||
classes.push('rounded-0');
|
||||
} else if (rounded === true || rounded === '') {
|
||||
classes.push(`${name}--rounded`);
|
||||
} else if (typeof rounded === 'string' || rounded === 0) {
|
||||
for (const value of String(rounded).split(' ')) {
|
||||
classes.push(`rounded-${value}`);
|
||||
}
|
||||
}
|
||||
return classes;
|
||||
});
|
||||
return {
|
||||
roundedClasses
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=rounded.js.map
|
||||
Reference in New Issue
Block a user