routie dev init since i didn't adhere to any proper guidance up until now
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
// Utilities
|
||||
import { h, mergeProps, Transition, TransitionGroup } from 'vue';
|
||||
import { isObject, onlyDefinedProps, propsFactory } from "../util/index.js"; // Types
|
||||
export const makeTransitionProps = propsFactory({
|
||||
transition: {
|
||||
type: null,
|
||||
default: 'fade-transition',
|
||||
validator: val => val !== true
|
||||
}
|
||||
}, 'transition');
|
||||
export const MaybeTransition = (props, {
|
||||
slots
|
||||
}) => {
|
||||
const {
|
||||
transition,
|
||||
disabled,
|
||||
group,
|
||||
...rest
|
||||
} = props;
|
||||
const {
|
||||
component = group ? TransitionGroup : Transition,
|
||||
...customProps
|
||||
} = isObject(transition) ? transition : {};
|
||||
let transitionProps;
|
||||
if (isObject(transition)) {
|
||||
transitionProps = mergeProps(customProps, onlyDefinedProps({
|
||||
disabled,
|
||||
group
|
||||
}), rest);
|
||||
} else {
|
||||
transitionProps = mergeProps({
|
||||
name: disabled || !transition ? '' : transition
|
||||
}, rest);
|
||||
}
|
||||
return h(component, transitionProps, slots);
|
||||
};
|
||||
//# sourceMappingURL=transition.js.map
|
||||
Reference in New Issue
Block a user