feat: improve cursor

This commit is contained in:
陈嘉涵
2020-01-11 15:46:47 +08:00
parent 5cbb9e2998
commit 2eb680723d
33 changed files with 97 additions and 24 deletions
+6 -6
View File
@@ -70,17 +70,17 @@ function ActionSheet(
}
function Option(item: ActionSheetItem, index: number) {
const disabled = item.disabled || item.loading;
const { disabled, loading, callback } = item;
function onClickOption(event: MouseEvent) {
event.stopPropagation();
if (item.disabled || item.loading) {
if (disabled || loading) {
return;
}
if (item.callback) {
item.callback(item);
if (callback) {
callback(item);
}
emit(ctx, 'select', item, index);
@@ -91,7 +91,7 @@ function ActionSheet(
}
function OptionContent() {
if (item.loading) {
if (loading) {
return <Loading size="20px" />;
}
@@ -104,7 +104,7 @@ function ActionSheet(
return (
<button
type="button"
class={[bem('item', { disabled }), item.className, BORDER_TOP]}
class={[bem('item', { disabled, loading }), item.className, BORDER_TOP]}
style={{ color: item.color }}
onClick={onClickOption}
>