Skip to content

Commit

Permalink
fix: modify name of import loading
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Jan 28, 2021
1 parent 01de29c commit 0b9d7e4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
48 changes: 24 additions & 24 deletions packages/varlet-ui/src/button/Button.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<template>
<button
v-ripple="{ disabled }"
class="var--box var-button"
:class="[
`var-button--${size}`,
block ? 'var--flex' : 'var--inline-flex',
disabled ? 'var-button--disabled' : null,
plain ? `var-button--plain-${type}` : `var-button--${type}`,
plain ? 'var-button--plain' : 'var-elevation--2',
round ? 'var-button--round' : null,
outline ? 'var-button--outline' : null,
]"
:style="{
color: textColor,
background: color,
}"
:disabled="disabled"
@click="handleClick"
@touchstart="handleTouchstart"
>
<var-loading :type="loadingType" :size="loadingSize" v-if="loading" />
<slot v-else />
</button>
<button
v-ripple="{ disabled }"
class="var--box var-button"
:class="[
`var-button--${size}`,
block ? 'var--flex' : 'var--inline-flex',
disabled ? 'var-button--disabled' : null,
plain ? `var-button--plain-${type}` : `var-button--${type}`,
plain ? 'var-button--plain' : 'var-elevation--2',
round ? 'var-button--round' : null,
outline ? 'var-button--outline' : null,
]"
:style="{
color: textColor,
background: color,
}"
:disabled="disabled"
@click="handleClick"
@touchstart="handleTouchstart"
>
<var-loading :type="loadingType" :size="loadingSize" v-if="loading" />
<slot v-else />
</button>
</template>

<script lang="ts">
import Ripple from '../ripple'
import Loading from '../Loading'
import Loading from '../loading'
import { defineComponent } from 'vue'
import { props } from './props'
Expand Down
82 changes: 41 additions & 41 deletions packages/varlet-ui/src/switch/Switch.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<template>
<div class="var-switch">
<div
class="var-switch-block"
:class="[disabled || formDisabled ? 'var-switch__disable' : null]"
@click="switchActive"
:style="styleComputed.switch"
>
<div
:style="styleComputed.track"
class="var-switch__track"
:class="[modelValue ? 'var-switch__track-active' : null, errorMessage ? 'var-switch__track-error' : null]"
></div>
<div
class="var-switch__ripple"
:style="styleComputed.ripple"
v-ripple="{
disabled: !ripple || disabled || loading || formDisabled,
}"
>
<div
:style="styleComputed.handle"
class="var-switch__handle var-elevation--2"
:class="[modelValue ? 'var-switch__handle-active' : null, errorMessage ? 'var-switch__handle-error' : null]"
>
<var-loading v-if="loading" :radius="size / 2 - 2" />
</div>
</div>
</div>
<var-form-details :error-message="errorMessage" />
</div>
<div class="var-switch">
<div
class="var-switch-block"
:class="[disabled || formDisabled ? 'var-switch__disable' : null]"
@click="switchActive"
:style="styleComputed.switch"
>
<div
:style="styleComputed.track"
class="var-switch__track"
:class="[modelValue ? 'var-switch__track-active' : null, errorMessage ? 'var-switch__track-error' : null]"
></div>
<div
class="var-switch__ripple"
:style="styleComputed.ripple"
v-ripple="{
disabled: !ripple || disabled || loading || formDisabled,
}"
>
<div
:style="styleComputed.handle"
class="var-switch__handle var-elevation--2"
:class="[modelValue ? 'var-switch__handle-active' : null, errorMessage ? 'var-switch__handle-error' : null]"
>
<var-loading v-if="loading" :radius="size / 2 - 2" />
</div>
</div>
</div>
<var-form-details :error-message="errorMessage" />
</div>
</template>

<script lang="ts">
Expand All @@ -38,16 +38,16 @@ import { FORM_BIND_FORM_ITEM_KEY, FormProvider } from '../form/provide'
import { SwitchProvider } from './provide'
import { props } from './props'
import FormDetails from '../form-details'
import Loading from '../Loading'
import Loading from '../loading'
import Ripple from '../ripple'
type StyleProps = {
width: string
height: string
left: string
borderRadius: string
backgroundColor: string
color: string
width: string
height: string
left: string
borderRadius: string
backgroundColor: string
color: string
}
export default defineComponent({
Expand Down Expand Up @@ -103,10 +103,10 @@ export default defineComponent({
props.onClick?.()
if (
props.disabled ||
props.loading ||
props.readonly ||
formProvider?.disabled.value ||
formProvider?.readonly.value
props.loading ||
props.readonly ||
formProvider?.disabled.value ||
formProvider?.readonly.value
)
return
props.onChange?.(!props.modelValue)
Expand Down

0 comments on commit 0b9d7e4

Please sign in to comment.