-
Notifications
You must be signed in to change notification settings - Fork 330
feat(exception): Add pc templates, document examples, and dark mode support #3736
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
Merged
Merged
Changes from all commits
Commits
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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
15 changes: 15 additions & 0 deletions
15
examples/sites/demos/pc/app/exception/basic-usage-composition-api.vue
This file contains hidden or 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> | ||
| <div class="exception-demo"> | ||
| <tiny-exception type="nodata"></tiny-exception> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyException } from '@opentiny/vue' | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .exception-demo { | ||
| padding: 20px; | ||
| } | ||
| </style> |
This file contains hidden or 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,21 @@ | ||
| <template> | ||
| <div class="exception-demo"> | ||
| <tiny-exception type="nodata"></tiny-exception> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyException } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyException | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .exception-demo { | ||
| padding: 20px; | ||
| } | ||
| </style> |
13 changes: 13 additions & 0 deletions
13
examples/sites/demos/pc/app/exception/button-text-composition-api.vue
This file contains hidden or 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,13 @@ | ||
| <template> | ||
| <tiny-exception type="pagenoperm"> | ||
| <tiny-button type="primary" @click="test">自定义按钮</tiny-button> | ||
| </tiny-exception> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyException, TinyModal, TinyButton } from '@opentiny/vue' | ||
|
|
||
| const test = () => { | ||
| TinyModal.message({ status: 'info', message: '自定义按钮被点击' }) | ||
| } | ||
| </script> | ||
This file contains hidden or 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,21 @@ | ||
| <template> | ||
| <tiny-exception type="pagenoperm"> | ||
| <tiny-button type="primary" @click="test">立即新建</tiny-button> | ||
| </tiny-exception> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyException, TinyModal, TinyButton } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyException, | ||
| TinyButton | ||
| }, | ||
| methods: { | ||
| test() { | ||
| TinyModal.message({ status: 'info', message: '自定义按钮被点击' }) | ||
| } | ||
| } | ||
| } | ||
| </script> |
44 changes: 44 additions & 0 deletions
44
examples/sites/demos/pc/app/exception/component-page-composition-api.vue
This file contains hidden or 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,44 @@ | ||
| <template> | ||
| <div> | ||
| <tiny-grid :data="tableData" height="300"> | ||
| <tiny-grid-column type="index" width="5%"></tiny-grid-column> | ||
| <tiny-grid-column field="name" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| <template #empty> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| </tiny-grid> | ||
| <div class="demo-split"> | ||
| <tiny-split v-model="split2"> | ||
| <template #left> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| <template #right> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| </tiny-split> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyGrid, TinyGridColumn, TinyException, TinySplit } from '@opentiny/vue' | ||
| import { ref } from 'vue' | ||
|
|
||
| const tableData = ref([]) | ||
| const split2 = ref(0.4) | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .demo-split { | ||
| height: 200px; | ||
| border: 1px solid #d9d9d9; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .demo-split-pane { | ||
| padding: 10px; | ||
| } | ||
| </style> |
This file contains hidden or 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,55 @@ | ||
| <template> | ||
| <div> | ||
| <tiny-grid :data="tableData" height="300"> | ||
| <tiny-grid-column type="index" width="5%"></tiny-grid-column> | ||
| <tiny-grid-column field="name" title="名称"></tiny-grid-column> | ||
| <tiny-grid-column field="area" title="区域"></tiny-grid-column> | ||
| <tiny-grid-column field="address" title="地址"></tiny-grid-column> | ||
| <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column> | ||
| <template #empty> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| </tiny-grid> | ||
| <div class="demo-split"> | ||
| <tiny-split v-model="split2"> | ||
| <template #left> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| <template #right> | ||
| <tiny-exception component-page type="nodata"></tiny-exception> | ||
| </template> | ||
| </tiny-split> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyGrid, TinyGridColumn, TinyException, TinySplit } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyGrid, | ||
| TinyGridColumn, | ||
| TinyException, | ||
| TinySplit | ||
| }, | ||
| data() { | ||
| return { | ||
| tableData: [], | ||
| split2: 0.4 | ||
| } | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .demo-split { | ||
| height: 200px; | ||
| border: 1px solid #d9d9d9; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .demo-split-pane { | ||
| padding: 10px; | ||
| } | ||
| </style> |
7 changes: 7 additions & 0 deletions
7
examples/sites/demos/pc/app/exception/page-empty-composition-api.vue
This file contains hidden or 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,7 @@ | ||
| <template> | ||
| <tiny-exception page-empty type="pageservererror" sub-message="服务器错误" /> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyException } from '@opentiny/vue' | ||
| </script> |
This file contains hidden or 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,13 @@ | ||
| <template> | ||
| <tiny-exception page-empty type="pageservererror" sub-message="服务器错误" /> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyException } from '@opentiny/vue' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyException | ||
| } | ||
| } | ||
| </script> |
29 changes: 29 additions & 0 deletions
29
examples/sites/demos/pc/app/exception/slot-composition-api.vue
This file contains hidden or 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,29 @@ | ||
| <template> | ||
| <tiny-exception type="pagenoperm"> | ||
| <template #icon> | ||
| <TinyIconSuccess class="custom-icon" /> | ||
| </template> | ||
| <template #content> | ||
| <div class="content">content插槽</div> | ||
| <tiny-button type="primary">自定义按钮</tiny-button> | ||
| </template> | ||
| </tiny-exception> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { TinyException, TinyButton } from '@opentiny/vue' | ||
| import { IconSuccess } from '@opentiny/vue-icon' | ||
|
|
||
| const TinyIconSuccess = IconSuccess() | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .content { | ||
| padding-bottom: 15px; | ||
| font-size: 16px; | ||
| } | ||
| .custom-icon { | ||
| width: 50px; | ||
| height: 50px; | ||
| } | ||
| </style> |
This file contains hidden or 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,23 @@ | ||
| <template> | ||
| <tiny-exception> | ||
| <template #icon> | ||
| <IconSuccess /> | ||
| </template> | ||
| <template #content> | ||
| <div>content插槽</div> | ||
| </template> | ||
| <tiny-button type="primary">立即新建</tiny-button> | ||
| </tiny-exception> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { TinyException } from '@opentiny/vue' | ||
| import { IconSuccess } from '@opentiny/vue-icon' | ||
|
|
||
| export default { | ||
| components: { | ||
| TinyException, | ||
| IconSuccess: IconSuccess() | ||
| } | ||
| } | ||
| </script> |
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.
Uh oh!
There was an error while loading. Please reload this page.