-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(numeric): [numeric] add step strategy of props (#2584)
* feat(numeric): [numeric] add step strategy of props * fix(numeric): [numeric] modify condition * fix(numeric): [numeric] modify description * fix(numeric): [numeric] modify review * fix(numeric): [numeric] modify review
- Loading branch information
1 parent
3018041
commit 5f7a69f
Showing
7 changed files
with
152 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 32 additions & 2 deletions
34
examples/sites/demos/pc/app/numeric/about-step-composition-api.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,41 @@ | ||
<template> | ||
<tiny-numeric v-model="value" :step="step"></tiny-numeric> | ||
<div class="m-layout"> | ||
<div class="m-b10"> | ||
<div class="m-b10">1、step 用法</div> | ||
<tiny-numeric v-model="value" :step="step"></tiny-numeric> | ||
<br /> | ||
<tiny-numeric v-model="restrictValue" :step="stepRestrictly"></tiny-numeric> | ||
</div> | ||
<div> | ||
<div class="m-b10">2、step-strictly 用法</div> | ||
<tiny-numeric v-model="valueStep" :step="step.value" step-strictly></tiny-numeric> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { TinyNumeric } from '@opentiny/vue' | ||
const value = ref(0) | ||
const step = ref(2) | ||
const restrictValue = ref(0) | ||
const step = ref({ | ||
value: 5, | ||
mode: 'restore' | ||
}) | ||
const stepRestrictly = ref({ | ||
value: 5, | ||
mode: 'strictly' | ||
}) | ||
const valueStep = ref(0) | ||
</script> | ||
|
||
<style scoped> | ||
.m-layout { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
.m-b10 { | ||
margin-bottom: 10px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters