-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from Tencent/feat/slider
Refactor: 重构 Slider 组件
- Loading branch information
Showing
18 changed files
with
536 additions
and
545 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,6 @@ | |
.slider-demo { | ||
background-color: #fff; | ||
padding: 12px 16px; | ||
max-height: 69px; | ||
} | ||
|
||
.stepper-demo { | ||
|
Submodule _common
updated
13 files
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,9 @@ | ||
<template> | ||
<div class="cell-base"> | ||
<t-cell-group title="基础滑动选择器"> | ||
<t-cell label="选择器标题"> | ||
<t-slider v-model="value" @change="onChange"> </t-slider> | ||
</t-cell> | ||
<t-cell label="禁用选择器"> | ||
<t-slider v-model="value" disabled> </t-slider> | ||
</t-cell> | ||
</t-cell-group> | ||
</div> | ||
<t-slider v-model="value" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { ref, defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
export default defineComponent({ | ||
setup() { | ||
const value = ref(60); | ||
function onChange($event: number | number[]) { | ||
console.log(`change to ${$event}`); | ||
} | ||
return { | ||
value, | ||
onChange, | ||
}; | ||
}, | ||
}); | ||
const value = ref(60); | ||
</script> |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<div class="section"> | ||
<t-slider :default-value="60" disabled /> | ||
</div> | ||
<div class="section"> | ||
<t-slider :default-value="30" show-extreme-value :min="30" disabled /> | ||
</div> | ||
<div class="section"> | ||
<t-slider :default-value="50" :marks="marks" disabled /> | ||
</div> | ||
<div class="section"> | ||
<t-slider :default-value="[30, 80]" range disabled /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
const marks = ref({ 0: '小', 50: '中', 100: '大' }); | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.section { | ||
// display: flex; | ||
align-items: center; | ||
padding-top: 16px; | ||
padding-bottom: 16px; | ||
& + .section { | ||
margin-top: 16px; | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
<template> | ||
<div class="cell-base"> | ||
<t-cell-group title="带刻度滑动选择器"> | ||
<t-cell label="选择器标题"> | ||
<t-slider v-model="value" :marks="marks"> </t-slider> | ||
</t-cell> | ||
<t-cell label="禁用选择器"> | ||
<t-slider v-model="value" disabled :marks="marks"> </t-slider> | ||
</t-cell> | ||
</t-cell-group> | ||
</div> | ||
<t-slider v-model="value" :marks="marks" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { ref, defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
export default defineComponent({ | ||
setup() { | ||
const value = ref(50); | ||
const marks = ref({ 0: '小', 50: '中', 100: '大' }); | ||
return { | ||
value, | ||
marks, | ||
}; | ||
}, | ||
}); | ||
const value = ref(50); | ||
const marks = ref({ 0: '小', 50: '中', 100: '大' }); | ||
// const marks = ref([0, 50, 100]); | ||
// const marks = ref({ | ||
// 0: (val: number) => `${val}%`, | ||
// 50: (val: number) => `${val}%`, | ||
// 100: (val: number) => `${val}%`, | ||
// }); | ||
</script> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,13 @@ | ||
<template> | ||
<div class="cell-base"> | ||
<t-cell-group title="区间滑动选择器"> | ||
<t-cell label="选择器标题"> | ||
<t-slider v-model="rangeValue" show-value range @change="onChange"> </t-slider> | ||
</t-cell> | ||
<t-cell label="禁用选择器"> | ||
<t-slider v-model="rangeValue" range disabled> </t-slider> | ||
</t-cell> | ||
</t-cell-group> | ||
</div> | ||
<t-slider v-model="rangeValue" show-value range @change="onChange" /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { ref, defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
export default defineComponent({ | ||
setup() { | ||
const rangeValue = ref([30, 80]); | ||
function onChange($event: number | number[]) { | ||
console.log(`change to ${$event}`); | ||
} | ||
return { | ||
rangeValue, | ||
onChange, | ||
}; | ||
}, | ||
}); | ||
const rangeValue = ref([30, 80]); | ||
function onChange($event: number | number[]) { | ||
console.log(`change to ${$event}`); | ||
} | ||
</script> |
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,25 +1,9 @@ | ||
<template> | ||
<div class="cell-base"> | ||
<t-cell-group title="带数字滑动选择器"> | ||
<t-cell label="选择器标题"> | ||
<t-slider v-model="value" show-value> </t-slider> | ||
</t-cell> | ||
<t-cell label="禁用选择器"> | ||
<t-slider v-model="value" disabled show-value> </t-slider> | ||
</t-cell> | ||
</t-cell-group> | ||
</div> | ||
<t-slider v-model="value" show-value /> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { ref, defineComponent } from 'vue'; | ||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
export default defineComponent({ | ||
setup() { | ||
const value = ref(60); | ||
return { | ||
value, | ||
}; | ||
}, | ||
}); | ||
const value = ref(60); | ||
</script> |
Oops, something went wrong.