-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
397 additions
and
34 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const value1 = ref(0); | ||
const value2 = ref(10); | ||
const value3 = ref(0); | ||
const value4 = ref(0); | ||
const value5 = ref(0); | ||
const formatTooltip = (val: number) => { | ||
return val / 100; | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="slider-demo-block"> | ||
<span class="demonstration">默认值</span> | ||
<el-slider v-model="value1" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="demonstration">自定义初始值</span> | ||
<el-slider v-model="value2" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="demonstration">隐藏 Tooltip 提示</span> | ||
<el-slider v-model="value3" :show-tooltip="false" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="demonstration">格式化 Tooltip 提示</span> | ||
<el-slider v-model="value4" :format-tooltip="formatTooltip" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="demonstration">禁用</span> | ||
<el-slider v-model="value5" disabled /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.slider-demo-block { | ||
display: flex; | ||
align-items: center; | ||
max-width: 600px; | ||
} | ||
.slider-demo-block .el-slider { | ||
margin-top: 0; | ||
margin-left: 12px; | ||
} | ||
.slider-demo-block .demonstration { | ||
flex: 1; | ||
margin-bottom: 0; | ||
overflow: hidden; | ||
font-size: 14px; | ||
line-height: 44px; | ||
color: var(--el-text-color-secondary); | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
.slider-demo-block .demonstration + .el-slider { | ||
flex: 0 0 70%; | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const value = ref(0); | ||
</script> | ||
|
||
<template> | ||
<div class="slider-demo-block"> | ||
<el-slider v-model="value" show-input /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.slider-demo-block { | ||
display: flex; | ||
align-items: center; | ||
max-width: 600px; | ||
} | ||
.slider-demo-block .el-slider { | ||
margin-top: 0; | ||
margin-left: 12px; | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script setup lang="ts"> | ||
import { reactive, ref } from "vue"; | ||
import type { CSSProperties } from "vue"; | ||
interface Mark { | ||
style: CSSProperties; | ||
label: string; | ||
} | ||
type Marks = Record<number, Mark | string>; | ||
const value = ref([30, 60]); | ||
const marks = reactive<Marks>({ | ||
0: "0°C", | ||
8: "8°C", | ||
37: "37°C", | ||
50: { | ||
style: { | ||
color: "#1989FA" | ||
}, | ||
label: "50%" | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div class="slider-demo-block"> | ||
<el-slider v-model="value" range :marks="marks" /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.slider-demo-block { | ||
display: flex; | ||
align-items: center; | ||
max-width: 600px; | ||
} | ||
.slider-demo-block .el-slider { | ||
margin-top: 0; | ||
margin-left: 12px; | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const value1 = ref(0); | ||
const value2 = ref(0); | ||
const value3 = ref(0); | ||
const value4 = ref(0); | ||
</script> | ||
|
||
<template> | ||
<div class="slider-demo-block"> | ||
<span class="mr-2">上</span> | ||
<el-slider v-model="value1" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="mr-2">下</span> | ||
<el-slider v-model="value2" placement="bottom" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="mr-2">左</span> | ||
<el-slider v-model="value4" placement="left" /> | ||
</div> | ||
<div class="slider-demo-block"> | ||
<span class="mr-2">右</span> | ||
<el-slider v-model="value3" placement="right" /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.slider-demo-block { | ||
display: flex; | ||
align-items: center; | ||
max-width: 600px; | ||
} | ||
.slider-demo-block .el-slider { | ||
margin-top: 0; | ||
margin-left: 12px; | ||
} | ||
</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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
const value = ref([4, 8]); | ||
</script> | ||
|
||
<template> | ||
<div class="slider-demo-block"> | ||
<el-slider v-model="value" range show-stops :max="10" /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.slider-demo-block { | ||
display: flex; | ||
align-items: center; | ||
max-width: 600px; | ||
} | ||
.slider-demo-block .el-slider { | ||
margin-top: 0; | ||
margin-left: 12px; | ||
} | ||
</style> |
Oops, something went wrong.