Skip to content

Commit

Permalink
fix: 修复uni-app-x演示遗留的slot旧语法
Browse files Browse the repository at this point in the history
  • Loading branch information
jry committed Aug 28, 2024
1 parent 7ed1f86 commit 0a66a48
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 233 deletions.
14 changes: 8 additions & 6 deletions uni-app-x/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,14 @@
// "style": {
// "navigationBarTitleText": "骨架屏"
// }
// }, {
// "path": "input/input",
// "style": {
// "navigationBarTitleText": "输入框"
// }
// }, {
// }
,{
"path": "input/input",
"style": {
"navigationBarTitleText": "输入框"
}
}
// , {
// "path": "album/album",
// "style": {
// "navigationBarTitleText": "相册"
Expand Down
25 changes: 13 additions & 12 deletions uni-app-x/pages/componentsA/cell/cell.uvue
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,20 @@
<text class="u-page__item__title">自定义插槽</text>
<up-cell-group>
<up-cell value="内容">
<view
slot="title"
class="u-slot-title"
>
<text class="u-cell-text">单元格</text>
<up-tag
text="标签"
plain
size="mini"
type="warning"
<template #title>
<view
class="u-slot-title"
>
</up-tag>
</view>
<text class="u-cell-text">单元格</text>
<up-tag
text="标签"
plain
size="mini"
type="warning"
>
</up-tag>
</view>
</template>
</up-cell>
<up-cell
title="单元格"
Expand Down
13 changes: 7 additions & 6 deletions uni-app-x/pages/componentsA/empty/empty.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
<template #icon>
<image
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
</template>
</up-cell>
</div>
</view>
Expand Down
13 changes: 7 additions & 6 deletions uni-app-x/pages/componentsA/loading-page/loading-page.uvue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item['iconUrl']"
mode="widthFix"
></image>
<template #icon>
<image
class="u-cell-icon"
:src="item['iconUrl']"
mode="widthFix"
></image>
</template>
</up-cell>
</up-cell-group>
<up-loading-page
Expand Down
13 changes: 7 additions & 6 deletions uni-app-x/pages/componentsA/overlay/overlay.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
<template #icon>
<image
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
</template>
</up-cell>
<up-overlay
:show="show"
Expand Down
14 changes: 8 additions & 6 deletions uni-app-x/pages/componentsA/popup/popup.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
<template #icon>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
</template>
</up-cell>
</up-cell-group>
<up-popup
Expand Down
14 changes: 8 additions & 6 deletions uni-app-x/pages/componentsB/actionSheet/actionSheet.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
<template #icon>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
</template>
</up-cell>
</up-cell-group>
<up-action-sheet
Expand Down
123 changes: 39 additions & 84 deletions uni-app-x/pages/componentsB/collapse/collapse.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -2,146 +2,101 @@
<view class="u-page">
<view class="u-page__item">
<text class="u-page__item__title">基础功能</text>
<up-collapse
@change="change"
@close="close"
@open="open"
>
<up-collapse-item
title="文档指南"
name="Docs guide"
>
<up-collapse @change="change" @close="close" @open="open">
<up-collapse-item title="文档指南" name="Docs guide">
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item>
<up-collapse-item
title="组件全面"
name="Variety components"
>
<up-collapse-item title="组件全面" name="Variety components">
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<up-collapse-item
title="众多利器"
name="Numerous tools"
>
<up-collapse-item title="众多利器" name="Numerous tools" :showRight="false">
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
</view>
<view class="u-page__item">
<text class="u-page__item__title">展开和禁用</text>
<up-collapse
:value="['2']"
>
<up-collapse-item
title="文档指南"
>
<up-collapse :value="['2']">
<up-collapse-item title="文档指南">
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item>
<up-collapse-item
disabled
title="组件全面"
>
<up-collapse-item disabled title="组件全面">
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<up-collapse-item
name="2"
title="众多利器"
>
<up-collapse-item name="2" title="众多利器">
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
</view>
<view class="u-page__item">
<text class="u-page__item__title">手风琴模式</text>
<up-collapse
accordion
>
<up-collapse-item
title="文档指南"
>
<up-collapse accordion>
<up-collapse-item title="文档指南">
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item>
<up-collapse-item
title="组件全面"
>
<up-collapse-item title="组件全面">
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<up-collapse-item
title="众多利器"
>
<up-collapse-item title="众多利器">
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
</view>
<view class="u-page__item">
<text class="u-page__item__title">移除下划线</text>
<up-collapse
accordion
:border="false"
>
<up-collapse-item
title="文档指南"
>
<up-collapse accordion :border="false">
<up-collapse-item title="文档指南">
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item>
<up-collapse-item
title="组件全面"
>
<up-collapse-item title="组件全面">
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<up-collapse-item
title="众多利器"
>
<up-collapse-item title="众多利器">
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
</view>
<!-- 微信小程序不支持,因为微信中不支持 <slot name="title" slot="title" />的写法 -->
<!-- 微信小程序不支持,因为微信中不支持 <slot #title" />的写法 -->
<view class="u-page__item">
<text class="u-page__item__title">自定义标题和内容</text>
<up-collapse
accordion
>
<up-collapse-item
>
<up-collapse accordion>
<up-collapse-item>
<template #title>
<text class="u-page__item__title__slot-title">文档指南</text>
</template>
<tex<up-lass="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item>
<!-- <u-collapse-item
<!-- <up-collapse-item
:isLink="false"
>
<text slot="title" class="u-page__item__title__slot-title">文档指南</text>
<up-ext class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
<template #title>
<text class="u-page__item__title__slot-title">文档指南</text>
</template>
<text class="u-collapse-content">涵盖uniapp各个方面,给开发者方向指导和设计理念,让您茅塞顿开,一马平川</text>
</up-collapse-item> -->
<u-collapse-item
title="组件全面"<up-
>
<up-emplate v-slot:icon>
<u-icon name="tags-fill" size="20"></up-icon>
<up-collapse-item title="组件全面">
<template v-slot:icon>
<up-icon name="tags-fill" size="20"></up-icon>
</template>
<text class="u-collapse-content">众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让您快速集成,开箱即用</text>
</up-collapse-item>
<u-collapse-item
title="众多利器" icon="tags-fill"
<up-
<template v-slot:value>
<text class="u-page__item__title__slot-title">自定义内容</text>
<up-collapse-item title="众多利器" icon="tags-fill">
<template v-slot:right-icon>
<text class="u-page__item__title__slot-title">10</text>
</template>
<text class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
<text
class="u-collapse-content">众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text>
</up-collapse-item>
</up-collapse>
</view>
<u-gap height="50"></up-gap>
<up-gap height="50"></up-gap>
</view>
</template>

<script>
export default {
data() {
return {
}
return {}
},
methods: {
open(e) {
Expand All @@ -160,15 +115,15 @@
<style lang="scss">
.u-page {
padding: 0;

&__item {

&__title {
color: $u-tips-color;
background-color: $u-bg-color;
padding: 15px;
font-size: 15px;

&__slot-title {
color: $u-primary;
font-size: 14px;
Expand All @@ -181,4 +136,4 @@
color: $u-tips-color;
font-size: 14px;
}
</style>
</style>
13 changes: 7 additions & 6 deletions uni-app-x/pages/componentsB/keyboard/keyboard.nvue
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
:key="index"
isLink
>
<image
slot="icon"
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
<template #icon>
<image
class="u-cell-icon"
:src="item.iconUrl"
mode="widthFix"
></image>
</template>
</up-cell>
</up-cell-group>
<up-keyboard
Expand Down
Loading

0 comments on commit 0a66a48

Please sign in to comment.