Skip to content

Commit 777d704

Browse files
committed
docs(recent-color): update demo for recent colors
1 parent 4fb1fec commit 777d704

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

packages/components/color-picker/_example/recent-color.vue

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@
22
<t-space>
33
<t-space direction="vertical" size="small">
44
<p>预设最近使用色</p>
5-
<t-color-picker-panel
6-
v-model="color"
7-
:recent-colors="[
8-
'red',
9-
'green',
10-
'yellow',
11-
'blue',
12-
'purple',
13-
'linear-gradient(to right, #fa709a 0%, #fee140 100%)',
14-
'linear-gradient(45deg, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%)',
15-
'linear-gradient(120deg, #fcc5e4 0%, #fda34b 15%, #ff7882 35%, #c8699e 52%, #7046aa 71%, #0c1db8 87%, #020f75 100%)',
16-
]"
17-
/>
5+
<t-color-picker-panel v-model="color" :default-recent-colors="recentColors" />
186
</t-space>
197

208
<t-space direction="vertical" size="small">
@@ -25,8 +13,16 @@
2513
</template>
2614
<script setup>
2715
import { ref } from 'vue';
28-
2916
const color = ref('#0052d9');
17+
const recentColors = ref([
18+
'red',
19+
'green',
20+
'yellow',
21+
'blue',
22+
'purple',
23+
'linear-gradient(to right, #fa709a 0%, #fee140 100%)',
24+
'linear-gradient(45deg, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%)',
25+
]);
3026
</script>
3127
<style scoped>
3228
p {

0 commit comments

Comments
 (0)