mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore: adjust code
This commit is contained in:
parent
82ac453910
commit
3c415c42d0
@ -86,7 +86,7 @@ export default createComponent({
|
||||
const onClick = () => {
|
||||
emit('select', item, index);
|
||||
if (props.closeOnClickAction) {
|
||||
emit('update:show', false);
|
||||
onUpdateShow(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -21,13 +21,13 @@ export default createComponent({
|
||||
emits: ['click'],
|
||||
|
||||
setup(props, { emit }) {
|
||||
function onClick(event) {
|
||||
const onClick = (event) => {
|
||||
if (props.editable) {
|
||||
emit('click', event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Content() {
|
||||
const renderContent = () => {
|
||||
if (props.type === 'add') {
|
||||
return props.addText || t('addText');
|
||||
}
|
||||
@ -36,19 +36,19 @@ export default createComponent({
|
||||
<div>{`${t('name')}:${props.name}`}</div>,
|
||||
<div>{`${t('tel')}:${props.tel}`}</div>,
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
return () => (
|
||||
<Cell
|
||||
center
|
||||
icon={props.type === 'edit' ? 'contact' : 'add-square'}
|
||||
class={bem([props.type])}
|
||||
border={false}
|
||||
isLink={props.editable}
|
||||
class={bem([props.type])}
|
||||
valueClass={bem('value')}
|
||||
icon={props.type === 'edit' ? 'contact' : 'add-square'}
|
||||
onClick={onClick}
|
||||
>
|
||||
{Content()}
|
||||
{renderContent()}
|
||||
</Cell>
|
||||
);
|
||||
},
|
||||
|
@ -107,7 +107,7 @@ export default createComponent({
|
||||
const text = slots.error ? slots.error() : props.errorText;
|
||||
if (text) {
|
||||
return (
|
||||
<div onClick={clickErrorText} class={bem('error-text')}>
|
||||
<div class={bem('error-text')} onClick={clickErrorText}>
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
|
@ -27,6 +27,11 @@ export default createComponent({
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
const spinnerStyle = computed(() => ({
|
||||
color: props.color,
|
||||
...getSizeStyle(props.size),
|
||||
}));
|
||||
|
||||
const renderText = () => {
|
||||
if (slots.default) {
|
||||
return (
|
||||
@ -42,11 +47,6 @@ export default createComponent({
|
||||
}
|
||||
};
|
||||
|
||||
const spinnerStyle = computed(() => ({
|
||||
color: props.color,
|
||||
...getSizeStyle(props.size),
|
||||
}));
|
||||
|
||||
return () => {
|
||||
const { type, vertical } = props;
|
||||
return (
|
||||
|
@ -151,12 +151,12 @@ export default createComponent({
|
||||
const renderButton = () => (
|
||||
<div
|
||||
role="slider"
|
||||
class={bem('button-wrapper')}
|
||||
tabindex={props.disabled ? -1 : 0}
|
||||
aria-valuemin={props.min}
|
||||
aria-valuenow={props.modelValue}
|
||||
aria-valuemax={props.max}
|
||||
aria-orientation={props.vertical ? 'vertical' : 'horizontal'}
|
||||
class={bem('button-wrapper')}
|
||||
onTouchstart={onTouchStart}
|
||||
onTouchmove={onTouchMove}
|
||||
onTouchend={onTouchEnd}
|
||||
|
Loading…
x
Reference in New Issue
Block a user