提交 364112ab 编写于 作者: X xiaoyucoding

modify: 条件编译屏蔽 H5 上不支持的示例

上级 506afee6
......@@ -10,12 +10,12 @@
<view class="uni-list">
<view class="uni-list-cell uni-collapse">
<view class="uni-list-cell-navigate uni-navigate-bottom" hover-class="uni-list-cell-hover" :class="list.open ? 'uni-active' : ''"
@click="trigerCollapse(index)">
@click="trigerCollapse(index)">
{{list.name}}
</view>
<view class="uni-list uni-collapse" :class="list.open ? 'uni-active' : ''">
<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,key) in list.pages" :key="key" :url="item.url"
@click="goDetailPage(item.url)">
@click="goDetailPage(item.url)">
<view class="uni-list-cell-navigate uni-navigate-right"> {{item.name}} </view>
</view>
</view>
......@@ -27,39 +27,44 @@
<script>
export default {
data() {
let list = [
{
let list = [{
id: 'page',
name: '界面',
open: false,
pages: [{
name: '设置界面标题',
url: 'set-navigation-bar-title'
}, {
name: '页面跳转',
url: 'navigator'
}, {
name: '下拉刷新',
url: 'pull-down-refresh'
}, {
name: '创建动画',
url: 'animation'
}, {
name: '创建绘画',
url: 'canvas'
}, {
name: '显示操作菜单',
url: 'action-sheet'
}, {
name: '显示模态弹窗',
url: 'modal'
}, {
name: '显示加载提示框',
url: 'show-loading'
}, {
name: '显示消息提示框',
url: 'toast'
}]
name: '设置界面标题',
url: 'set-navigation-bar-title'
}, {
name: '页面跳转',
url: 'navigator'
}, {
name: '下拉刷新',
url: 'pull-down-refresh'
},
//#ifndef H5
{
name: '创建动画',
url: 'animation'
},
{
name: '创建绘画',
url: 'canvas'
},
//#endif
{
name: '显示操作菜单',
url: 'action-sheet'
}, {
name: '显示模态弹窗',
url: 'modal'
}, {
name: '显示加载提示框',
url: 'show-loading'
}, {
name: '显示消息提示框',
url: 'toast'
}
]
}, {
id: 'device',
name: '设备',
......@@ -73,13 +78,17 @@
}, {
name: '打电话',
url: 'make-phone-call'
}, {
},
//#ifndef H5
{
name: '扫码',
url: 'scan-code'
}, {
name: '剪贴板',
url: 'clipboard'
}, {
},
//#endif
{
name: '监听加速度传感器',
url: 'on-accelerometer-change'
}, {
......@@ -117,19 +126,27 @@
pages: [{
name: '图片',
url: 'image'
}, {
},
//#ifndef H5
{
name: '录音',
url: 'voice'
}, {
name: '背景音频',
url: 'background-audio'
}, {
},
//#endif
{
name: '视频',
url: 'video'
}, {
},
//#ifndef H5
{
name: '文件',
url: 'file'
}]
},
//#endif
]
}, {
id: 'location',
name: '位置',
......@@ -152,7 +169,9 @@
name: '数据存储',
url: 'storage'
}]
}, {
},
//#ifndef H5
{
id: 'login',
name: '登录',
open: false,
......@@ -163,7 +182,8 @@
name: '获取用户信息',
url: 'get-user-info'
}]
}, {
},
{
id: 'payment',
name: '支付',
open: false,
......@@ -171,7 +191,8 @@
name: '发起支付',
url: 'request-payment'
}]
}, {
},
{
id: 'share',
name: '分享',
open: false,
......@@ -179,9 +200,10 @@
name: '分享',
url: 'share'
}]
}
},
//#endif
//#ifdef APP-PLUS
, {
{
id: 'speech',
name: '语音',
open: false,
......@@ -197,7 +219,7 @@
name: '推送',
url: '/platforms/app-plus/push/push'
}]
}
},
//#endif
];
return {
......@@ -210,7 +232,7 @@
path: '/pages/tabBar/API/API'
}
},
onNavigationBarButtonTap(e){
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: '/platforms/app-plus/about/about'
})
......@@ -237,13 +259,15 @@
</script>
<style>
.uni-card {
box-shadow: none;
}
.uni-list:after {
height: 0;
}
.uni-list:before {
height: 0;
}
</style>
.uni-card {
box-shadow: none;
}
.uni-list:after {
height: 0;
}
.uni-list:before {
height: 0;
}
</style>
......@@ -31,7 +31,14 @@
id: 'view',
name: '视图容器',
open: false,
pages: ['view', 'scroll-view', 'swiper', 'movable-view']
pages: [
'view',
'scroll-view',
'swiper',
//#ifndef H5
'movable-view',
//#endif
]
}, {
id: 'content',
name: '基础内容',
......@@ -60,13 +67,13 @@
name: '地图',
open: false,
pages: ['map']
// #ifndef H5
// #ifndef H5
}, {
id: 'web-view',
name: '网页',
open: false,
pages: ['web-view'],
// #endif
// #endif
}]
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册