[improvement] rename packages dir to src (#3659)

This commit is contained in:
neverland
2019-06-27 11:25:57 +08:00
committed by GitHub
parent 8489918dca
commit 75c79b7044
619 changed files with 21 additions and 21 deletions
+28
View File
@@ -0,0 +1,28 @@
@import '../style/var';
.van-goods-action-icon {
display: flex;
flex-direction: column;
justify-content: center;
min-width: @goods-action-icon-width;
height: @goods-action-icon-height;
color: @goods-action-icon-color;
font-size: @goods-action-icon-font-size;
line-height: 1;
text-align: center;
background-color: @white;
&:not(:first-child)::after {
border-left-width: 1px;
}
&:active {
background-color: @goods-action-icon-active-color;
}
&__icon {
width: 1em;
margin: 0 auto 5px;
font-size: @goods-action-icon-size;
}
}
+57
View File
@@ -0,0 +1,57 @@
import { createNamespace } from '../utils';
import Icon, { IconEvents } from '../icon';
import { emit, inherit } from '../utils/functional';
import { functionalRoute, routeProps, RouteProps } from '../utils/router';
// Types
import { CreateElement, RenderContext } from 'vue/types';
import { DefaultSlots } from '../utils/types';
export type GoodsActionIconProps = RouteProps & {
icon: string;
text?: string;
info?: string | number;
iconClass?: any;
};
const [createComponent, bem] = createNamespace('goods-action-icon');
function GoodsActionIcon(
h: CreateElement,
props: GoodsActionIconProps,
slots: DefaultSlots,
ctx: RenderContext<GoodsActionIconProps>
) {
function onClick(event: Event) {
emit(ctx, 'click', event);
functionalRoute(ctx);
}
return (
<div
role="button"
tabindex="0"
class={[bem(), 'van-hairline']}
onClick={onClick}
{...inherit(ctx)}
>
<Icon
class={[bem('icon'), props.iconClass]}
tag="div"
info={props.info}
name={props.icon}
/>
{slots.default ? slots.default() : props.text}
</div>
);
}
GoodsActionIcon.props = {
...routeProps,
text: String,
icon: String,
info: [String, Number],
iconClass: null as any
};
export default createComponent<GoodsActionIconProps, IconEvents>(GoodsActionIcon);