Skip to content

Commit

Permalink
fix: 修复数字动画demo开始按钮不生效bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Jan 6, 2023
1 parent a4d3d32 commit ecb1457
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/views/components/number.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="number">
<el-card header="数字动画">
<h1><me-number v-bind="props"></me-number></h1>
<h1><me-number v-bind="props" v-if="has"></me-number></h1>
<el-form label-width="150px" inline>
<el-form-item label="起始值">
<el-input-number v-model="props.start"></el-input-number>
Expand Down Expand Up @@ -37,13 +37,12 @@ const props = reactive({
disabled: false,
duration: 1000,
});
const has = ref(true);
const start = async () => {
const endNumber = props.end[0];
props.disabled = true;
props.end[0] = props.start;
has.value = false;
await nextTick();
props.disabled = false;
props.end[0] = endNumber;
has.value = true;
};
</script>
<style lang="scss" scoped>
Expand Down

0 comments on commit ecb1457

Please sign in to comment.