-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(rate): rate tips #582
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7,574 changes: 996 additions & 6,578 deletions
7,574
src/rate/__test__/__snapshots__/demo.test.jsx.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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,25 @@ | ||
<template> | ||
<tdesign-demo-block summary="只可选全星时"> | ||
<CustomCell title="点击或滑动" class="space"> | ||
<t-rate v-model="value1" /> | ||
</CustomCell> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="可选半星时"> | ||
<CustomCell title="点击或滑动" class="space"> | ||
<t-rate v-model="value2" allow-half /> | ||
</CustomCell> | ||
</tdesign-demo-block> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
import CustomCell from './components/custom-cell.vue'; | ||
|
||
const value1 = ref(3); | ||
const value2 = ref(3); | ||
</script> | ||
<style lang="less" scoped> | ||
.space { | ||
margin-bottom: 16px; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
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,13 +1,12 @@ | ||
<template> | ||
<CustomCell title="自定义数量"> | ||
<t-rate v-model="value" :count="4" clearable :gap="defaultGap" /> | ||
<CustomCell title="自定义评分数量"> | ||
<t-rate v-model="value" :count="3" /> | ||
</CustomCell> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
import CustomCell from './components/custom-cell.vue'; | ||
|
||
const defaultGap = 8; | ||
const value = ref(3); | ||
const value = ref(2); | ||
</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,15 @@ | ||
<template> | ||
<CustomCell title="自定义评分"> | ||
<t-rate v-model="value" icon="thumb-up" @change="changeValue" /> | ||
</CustomCell> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue'; | ||
import CustomCell from './components/custom-cell.vue'; | ||
|
||
const changeValue = (val: Number) => { | ||
console.log('current value is', val); | ||
}; | ||
const value = ref(3); | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,46 +2,43 @@ | |
<div class="tdesign-mobile-demo"> | ||
<h1 class="title">Rate 评分</h1> | ||
<p class="summary">用于对某行为/事物进行打分。</p> | ||
<tdesign-demo-block title="01 类型" summary="实心评分"> | ||
<FilledDemo /> | ||
<br /> | ||
<tdesign-demo-block title="01 组件类型" summary="实心评分"> | ||
<BaseDemo /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="空心评分"> | ||
<OutlineDemo /> | ||
<tdesign-demo-block summary="自定义评分"> | ||
<CustomDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="自定义数量评分"> | ||
<tdesign-demo-block summary="自定义评分数量"> | ||
<CountDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="半星评分"> | ||
<AllowHalfDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="带描述评分"> | ||
<TextDemo /> | ||
<ShowTextDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block title="02 组件状态"> | ||
<ActionDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="禁用评分"> | ||
<DisabledDemo /> | ||
<tdesign-demo-block title="03 组件样式" summary="评分大小"> | ||
<SizeDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="设置评分颜色"> | ||
<ColorDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block title="02 规格" summary="评价规格"> | ||
<SizeDemo /> | ||
</tdesign-demo-block> | ||
<tdesign-demo-block summary="自定义图标评分"> | ||
<IconDemo /> | ||
<tdesign-demo-block title="04 特殊样式" summary="竖向带描述评分"> | ||
<SpecialDemo /> | ||
</tdesign-demo-block> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import IconDemo from './icon.vue'; | ||
import BaseDemo from './base.vue'; | ||
import CustomDemo from './custom.vue'; | ||
import CountDemo from './count.vue'; | ||
import ShowTextDemo from './show-text.vue'; | ||
import ActionDemo from './action.vue'; | ||
import SizeDemo from './size.vue'; | ||
import ColorDemo from './color.vue'; | ||
import DisabledDemo from './disabled.vue'; | ||
import CountDemo from './count.vue'; | ||
import FilledDemo from './filled.vue'; | ||
import OutlineDemo from './outline.vue'; | ||
import TextDemo from './text.vue'; | ||
import AllowHalfDemo from './allow-half.vue'; | ||
import SpecialDemo from './special.vue'; | ||
</script> | ||
|
||
<style lang="less"> | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议把这个 custom-cell 组件移除,不要依赖任何二次封装的。
用户复制示例代码的时候就没法直接用了:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉CustomCell后,样式是单独都写在每个示例里面吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的。