提交 23e24be7 编写于 作者: DCloud-yinjiacheng's avatar DCloud-yinjiacheng

更新API示例

上级 20fdb4dc
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view class="uni-common-mt">
<view class="uni-common-mt"> <view class="uni-list">
<view class="uni-list"> <view class="uni-list-cell">
<view class="uni-list-cell"> <view class="uni-pd">
<view class="uni-pd"> <view class="uni-label" style="width:180px;">是否授权使用摄像头</view>
<view class="uni-label" style="width:180px;">是否授权使用摄像头</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="cameraAuthorized" />
</view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell-db">
<view class="uni-pd"> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="cameraAuthorized" />
<view class="uni-label" style="width:180px;">是否授权使用定位</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAuthorized" />
</view>
</view> </view>
<view class="uni-list-cell"> </view>
<view class="uni-pd"> <view class="uni-list-cell">
<view class="uni-label" style="width:180px;">定位准确度</view> <view class="uni-pd">
</view> <view class="uni-label" style="width:180px;">是否授权使用定位</view>
<view class="uni-list-cell-db"> </view>
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAccuracy" /> <view class="uni-list-cell-db">
</view> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAuthorized" />
</view> </view>
<view class="uni-list-cell"> </view>
<view class="uni-pd"> <view class="uni-list-cell">
<view class="uni-label" style="width:180px;">是否授权使用麦克风</view> <view class="uni-pd">
</view> <view class="uni-label" style="width:180px;">定位准确度</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="microphoneAuthorized" />
</view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell-db">
<view class="uni-pd"> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationAccuracy" />
<view class="uni-label" style="width:180px;">是否授权通知</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="notificationAuthorized" />
</view>
</view> </view>
</view> </view>
<view class="uni-padding-wrap"> <view class="uni-list-cell">
<view class="uni-btn-v"> <view class="uni-pd">
<button type="primary" @tap="getAppAuthorizeSetting">获取App授权设置</button> <view class="uni-label" style="width:180px;">是否授权使用麦克风</view>
</view> </view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="microphoneAuthorized" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">是否授权通知</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="notificationAuthorized" />
</view>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getAppAuthorizeSetting">获取App授权设置</button>
</view> </view>
</view> </view>
</view> </view>
......
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view class="uni-common-mt">
<view class="uni-common-mt"> <view class="uni-list">
<view class="uni-list"> <view class="uni-list-cell" v-for="(item,_) in items" style="align-items: center;">
<view class="uni-list-cell" v-for="(item,_) in items" style="align-items: center;"> <view class="uni-pd">
<view class="uni-pd"> <view class="uni-label" style="width:180px;">{{item.label}}</view>
<view class="uni-label" style="width:180px;">{{item.label}}</view> </view>
</view> <view class="uni-list-cell-db">
<view class="uni-list-cell-db"> <textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" /> </view>
</view> </view>
</view> </view>
</view> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <view class="uni-btn-v">
<view class="uni-btn-v"> <button type="primary" @tap="getAppBaseInfo">获取App基础信息</button>
<button type="primary" @tap="getAppBaseInfo">获取App基础信息</button> </view>
</view> </view>
</view> </view>
</view>
</view>
</template> </template>
<script> <script>
type Item = { type Item = {
......
<template> <template>
<view> <page-head title="getCurrentPages"></page-head>
<page-head title="getCurrentPages"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <button @click="_getCurrentPages">getCurrentPages</button>
<button @click="_getCurrentPages">getCurrentPages</button> <view v-if="pages.length" style="padding: 15px 0px">
<view v-if="pages.length" style="padding: 15px 0px"> <text>当前页面栈中 {{ pages.length }} 个页面,列表如下:</text>
<text>当前页面栈中 {{ pages.length }} 个页面,列表如下:</text> <template v-for="(page, index) in pages" :key="page.route">
<template v-for="(page, index) in pages" :key="page.route"> <text style="margin-top: 5px">index: {{ index }}, route: {{ page.route }}</text>
<text style="margin-top: 5px">index: {{ index }}, route: {{ page.route }}</text> </template>
</template>
</view>
</view> </view>
</view> </view>
</template> </template>
......
<template> <template>
<page-head id="page-head" title="getElementById-multiple-root-node"></page-head>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<page-head id="page-head" title="getElementById-multiple-root-node"></page-head>
<text id="text">this is text</text> <text id="text">this is text</text>
<view id="view" class="uni-common-mt" style="border: 1px solid red">this is view</view> <view id="view" class="uni-common-mt" style="border: 1px solid red">this is view</view>
<button class="uni-btn" @click="changePageHeadBackgroundColor"> <button class="uni-btn" @click="changePageHeadBackgroundColor">
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<button class="uni-btn" @click="changeTextColor">修改 text 字体颜色</button> <button class="uni-btn" @click="changeTextColor">修改 text 字体颜色</button>
<button class="uni-btn" @click="changeViewStyle"> <button class="uni-btn" @click="changeViewStyle">
修改 view 宽高及背景色 修改 view 宽高及背景色
</button> </button>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head id="page-head" title="getElementById"></page-head>
<page-head id="page-head" title="getElementById"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <text id="text">this is text</text>
<text id="text">this is text</text> <view id="view" class="uni-common-mt" style="border: 1px solid red">this is view</view>
<view id="view" class="uni-common-mt" style="border: 1px solid red">this is view</view> <button class="uni-btn" @click="changePageHeadBackgroundColor">
<button class="uni-btn" @click="changePageHeadBackgroundColor"> 修改 page-head 背景色
修改 page-head 背景色 </button>
</button> <button class="uni-btn" @click="changeTextColor">
<button class="uni-btn" @click="changeTextColor"> 修改 text 字体颜色
修改 text 字体颜色 </button>
</button> <button class="uni-btn" @click="changeViewStyle">
<button class="uni-btn" @click="changeViewStyle"> 修改 view 宽高及背景色
修改 view 宽高及背景色 </button>
</button> <button class="uni-btn" @click="goMultipleRootNode">
<button class="uni-btn" @click="goMultipleRootNode"> 跳转多根节点示例
跳转多根节点示例 </button>
</button>
</view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head title="getLaunchOptionsSync"></page-head>
<page-head title="getLaunchOptionsSync"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <button @click="getLaunchOptionsSync">getLaunchOptionsSync</button>
<button @click="getLaunchOptionsSync">getLaunchOptionsSync</button> <view v-if="launchOptionsPath.length > 0" class="uni-common-mt">
<view v-if="launchOptionsPath.length > 0" class="uni-common-mt"> <text>应用启动路径:</text>
<text>应用启动路径:</text> <text style="margin-top: 5px">{{ launchOptionsPath }}</text>
<text style="margin-top: 5px">{{ launchOptionsPath }}</text>
</view>
</view> </view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view style="padding: 4px;">
<view style="padding: 4px;"> <text class="hello-text">
<text class="hello-text"> 真机运行标准基座仅包含系统定位,即system。\n
真机运行标准基座仅包含系统定位,即system。\n 部分手机因gms兼容不好可能导致无法定位。\n
部分手机因gms兼容不好可能导致无法定位。\n gcj国标、逆地理信息等功能需三方sdk定位。如果需要类似能力可以下载腾讯定位插件,打包自定义基座。参考示例:</text>
gcj国标、逆地理信息等功能需三方sdk定位。如果需要类似能力可以下载腾讯定位插件,打包自定义基座。参考示例:</text> <u-link :href="'https://ext.dcloud.net.cn/plugin?id=14569'" :text="'https://ext.dcloud.net.cn/plugin?id=14569'" :inWhiteList="true"></u-link>
<u-link :href="'https://ext.dcloud.net.cn/plugin?id=14569'" :text="'https://ext.dcloud.net.cn/plugin?id=14569'" :inWhiteList="true"></u-link> </view>
</view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-list"> <view class="uni-list">
<radio-group @change="radioChange"> <radio-group @change="radioChange">
<radio class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value" <radio class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line': ''" :value="item.value" :class="index < items.length - 1 ? 'uni-list-cell-line': ''" :value="item.value"
:checked="index === current"> :checked="index === current">
{{item.name}} {{item.name}}
</radio> </radio>
</radio-group> </radio-group>
</view> </view>
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">高度信息</view> <view class="uni-list-cell-db">高度信息</view>
<switch :checked="altitudeSelect" @change="altitudeChange" /> <switch :checked="altitudeSelect" @change="altitudeChange" />
</view> </view>
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">开启高精度定位</view> <view class="uni-list-cell-db">开启高精度定位</view>
<switch :checked="isHighAccuracySelect" @change="highAccuracySelectChange" /> <switch :checked="isHighAccuracySelect" @change="highAccuracySelectChange" />
</view> </view>
<view class="uni-list-cell uni-list-cell-pd"> <view class="uni-list-cell uni-list-cell-pd">
<view class="uni-list-cell-db">是否解析地址信息</view> <view class="uni-list-cell-db">是否解析地址信息</view>
<switch :checked="geocodeSelect" @change="geocodeChange" /> <switch :checked="geocodeSelect" @change="geocodeChange" />
</view> </view>
<text>{{exeRet}}</text> <text>{{exeRet}}</text>
<view class="uni-btn-v"> <view class="uni-btn-v">
<button class="uni-btn" type="default" @tap="getLocationTap">获取定位</button> <button class="uni-btn" type="default" @tap="getLocationTap">获取定位</button>
</view>
</view> </view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-padding-wrap uni-common-mt"> <view style="background:#FFFFFF; padding:20px;">
<view style="background:#FFFFFF; padding:20px;"> <view class="uni-center">网络状态</view>
<view class="uni-center">网络状态</view> <view v-if="hasNetworkType == false">
<view v-if="hasNetworkType == false"> <view class="uni-center uni-common-mt">未获取</view>
<view class="uni-center uni-common-mt">未获取</view> <view class="uni-center uni-common-mt">请点击下面按钮获取网络状态</view>
<view class="uni-center uni-common-mt">请点击下面按钮获取网络状态</view>
</view>
<view v-if="hasNetworkType == true">
<view class="uni-center uni-common-mt">{{networkType}}</view>
</view>
</view> </view>
<view class="uni-btn-v uni-common-mt"> <view v-if="hasNetworkType == true">
<button type="primary" @tap="getNetworkType">获取设备网络状态</button> <view class="uni-center uni-common-mt">{{networkType}}</view>
<button class="uni-common-mt" @tap="clear">清空</button>
</view> </view>
</view> </view>
<view class="uni-btn-v uni-common-mt">
<button type="primary" @tap="getNetworkType">获取设备网络状态</button>
<button class="uni-common-mt" @tap="clear">清空</button>
</view>
</view> </view>
</template> </template>
<script> <script>
......
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view class="uni-common-mt">
<view class="uni-common-mt"> <view class="uni-list">
<view class="uni-list"> <view class="uni-list-cell">
<view class="uni-list-cell"> <view class="uni-pd">
<view class="uni-pd"> <view class="uni-label" style="width:180px;">蓝牙的系统开关</view>
<view class="uni-label" style="width:180px;">蓝牙的系统开关</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="bluetoothEnabled" />
</view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell-db">
<view class="uni-pd"> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="bluetoothEnabled" />
<view class="uni-label" style="width:180px;">地理位置的系统开关</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationEnabled" />
</view>
</view> </view>
<view class="uni-list-cell"> </view>
<view class="uni-pd"> <view class="uni-list-cell">
<view class="uni-label" style="width:180px;">Wi-Fi 的系统开关</view> <view class="uni-pd">
</view> <view class="uni-label" style="width:180px;">地理位置的系统开关</view>
<view class="uni-list-cell-db"> </view>
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="wifiEnabled" /> <view class="uni-list-cell-db">
</view> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="locationEnabled" />
</view>
</view>
<view class="uni-list-cell">
<view class="uni-pd">
<view class="uni-label" style="width:180px;">Wi-Fi 的系统开关</view>
</view> </view>
<view class="uni-list-cell"> <view class="uni-list-cell-db">
<view class="uni-pd"> <input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="wifiEnabled" />
<view class="uni-label" style="width:180px;">设备方向</view>
</view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceOrientation" />
</view>
</view> </view>
</view> </view>
<view class="uni-padding-wrap"> <view class="uni-list-cell">
<view class="uni-btn-v"> <view class="uni-pd">
<button type="primary" @tap="getSystemSetting">获取系统设置</button> <view class="uni-label" style="width:180px;">设备方向</view>
</view> </view>
<view class="uni-list-cell-db">
<input class="uni-input" type="text" :disabled="true" placeholder="未获取" :value="deviceOrientation" />
</view>
</view>
</view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getSystemSetting">获取系统设置</button>
</view> </view>
</view> </view>
</view> </view>
......
<template> <template>
<view> <page-head :title="title"></page-head>
<page-head :title="title"></page-head> <view class="uni-common-mt">
<view class="uni-common-mt"> <view class="uni-list">
<view class="uni-list"> <view class="uni-list-cell" v-for="(item, _) in items" style="align-items: center">
<view class="uni-list-cell" v-for="(item, _) in items" style="align-items: center"> <view class="uni-pd">
<view class="uni-pd"> <view class="uni-label" style="width: 180px">{{ item.label }}</view>
<view class="uni-label" style="width: 180px">{{ item.label }}</view>
</view>
<view class="uni-list-cell-db">
<textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
</view>
</view> </view>
</view> <view class="uni-list-cell-db">
<view class="uni-padding-wrap"> <textarea :auto-height="true" :disabled="true" placeholder="未获取" :value="item.value" />
<view class="uni-btn-v">
<button type="primary" @tap="getWindowInfo">获取窗口信息</button>
</view> </view>
</view> </view>
</view> </view>
<view class="uni-padding-wrap">
<view class="uni-btn-v">
<button type="primary" @tap="getWindowInfo">获取窗口信息</button>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
......
<template> <template>
<view> <view style="flex: 1;">
<button @click="addInterceptor">添加路由拦截器</button> <button @click="addInterceptor">添加路由拦截器</button>
<button @click="removeInterceptor">移除路由拦截器</button> <button @click="removeInterceptor">移除路由拦截器</button>
<text>点击下方按钮{{msg}}</text> <text>点击下方按钮{{msg}}</text>
......
<template> <template>
<view> <view style="flex: 1;">
<text style="text-align: center;">测试页面 1</text> <text style="text-align: center;">测试页面 1</text>
</view> </view>
</template> </template>
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
<style> <style>
</style> </style>
\ No newline at end of file
<template> <template>
<view> <view style="flex: 1;">
<text style="text-align: center;">测试页面 2</text> <text style="text-align: center;">测试页面 2</text>
</view> </view>
</template> </template>
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
<style> <style>
</style> </style>
\ No newline at end of file
<template> <template>
<view> <page-head title="loadFontFace-child"></page-head>
<page-head title="loadFontFace-child"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <text class="font-size-20">上一页全局加载字体:</text>
<text class="font-size-20">上一页全局加载字体:</text> <text class="font-size-20 line-height-40" style="font-family: UniFontFamily">font-family: uni.ttf</text>
<text class="font-size-20 line-height-40" style="font-family: UniFontFamily">font-family: uni.ttf</text> <view style="flex-direction: row;">
<view style="flex-direction: row;"> <text style="font-family: UniFontFamily;font-size:20px;">{{
<text style="font-family: UniFontFamily;font-size:20px;">{{ uniIcon1
uniIcon1 }}</text>
}}</text> <text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text>
<text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text> <text style="font-family: UniFontFamily;font-size:20px;">{{
<text style="font-family: UniFontFamily;font-size:20px;">{{ uniIcon2
uniIcon2 }}</text>
}}</text> <text style="margin-left:5px;line-height:22px;">\ue101</text>
<text style="margin-left:5px;line-height:22px;">\ue101</text>
</view>
<text class="uni-common-mt font-size-20">上一页非全局加载字体(不生效为正常):</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family: 阿里妈妈刀隶体-otf</text>
<!-- <text class="item" style="font-family: AlimamaDaoLiTiWOFF"
>font-family: 阿里妈妈刀隶体-woff</text
>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2"
>font-family: 阿里妈妈刀隶体-woff2</text
> -->
</view> </view>
<text class="uni-common-mt font-size-20">上一页非全局加载字体(不生效为正常):</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family: 阿里妈妈刀隶体-otf</text>
<!-- <text class="item" style="font-family: AlimamaDaoLiTiWOFF"
>font-family: 阿里妈妈刀隶体-woff</text
>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2"
>font-family: 阿里妈妈刀隶体-woff2</text
> -->
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head title="loadFontFace"></page-head>
<page-head title="loadFontFace"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <text class="font-size-20">全局加载字体:</text>
<text class="font-size-20">全局加载字体:</text> <text class="font-size-20 line-height-40" style="font-family: UniFontFamily">font-family: uni.ttf</text>
<text class="font-size-20 line-height-40" style="font-family: UniFontFamily">font-family: uni.ttf</text> <view style="flex-direction: row;">
<view style="flex-direction: row;"> <text class="font-size-20" style="font-family: UniFontFamily;">{{
<text class="font-size-20" style="font-family: UniFontFamily;">{{ uniIcon1
uniIcon1 }}</text>
}}</text> <text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text>
<text style="margin-left:5px;margin-right: 20px;line-height:22px;">\ue100</text> <text class="font-size-20" style="font-family: UniFontFamily;">{{
<text class="font-size-20" style="font-family: UniFontFamily;">{{ uniIcon2
uniIcon2 }}</text>
}}</text> <text style="margin-left:5px;line-height:22px;">\ue101</text>
<text style="margin-left:5px;line-height:22px;">\ue101</text>
</view>
<text class="uni-common-mt font-size-20">非全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf
(网络字体下载后生效)</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family:
阿里妈妈刀隶体-otf</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF">font-family: 阿里妈妈刀隶体-woff</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2">font-family: 阿里妈妈刀隶体-woff2</text>
<button class="uni-btn" @click="navigateToChild">跳转子页面测试字体生效范围</button>
</view> </view>
<text class="uni-common-mt font-size-20">非全局加载字体:</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf
(网络字体下载后生效)</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family:
阿里妈妈刀隶体-otf</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF">font-family: 阿里妈妈刀隶体-woff</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2">font-family: 阿里妈妈刀隶体-woff2</text>
<button class="uni-btn" @click="navigateToChild">跳转子页面测试字体生效范围</button>
</view> </view>
</template> </template>
<script> <script>
......
<template> <template>
<page-head title="new-page-1" />
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<page-head title="new-page-1" />
<text>onLoad 接收到参数</text> <text>onLoad 接收到参数</text>
<text>data: {{ data }}</text> <text>data: {{ data }}</text>
<button @tap="navigateBackWithDelta2" class="uni-btn"> <button @tap="navigateBackWithDelta2" class="uni-btn">
......
<template> <template>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap" style="flex: 1;">
<page-head title="new-page-3" /> <page-head title="new-page-3" />
</view> </view>
</template> </template>
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
<style> <style>
.page { .page {
padding: 15px; padding: 15px;
flex: 1;
} }
.btn { .btn {
...@@ -141,4 +142,4 @@ ...@@ -141,4 +142,4 @@
font-weight: bold; font-weight: bold;
line-height: 2; line-height: 2;
} }
</style> </style>
\ No newline at end of file
<template> <template>
<view> <page-head title="setNavigationBarColor"></page-head>
<page-head title="setNavigationBarColor"></page-head> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-padding-wrap uni-common-mt"> <button @tap="setNavigationBarColor1" class="uni-btn">
<button @tap="setNavigationBarColor1" class="uni-btn"> 设置导航条背景绿色,标题白色
设置导航条背景绿色,标题白色 </button>
</button> <button @tap="setNavigationBarColor2" class="uni-btn">
<button @tap="setNavigationBarColor2" class="uni-btn"> 设置导航条背景红色,标题黑色
设置导航条背景红色,标题黑色 </button>
</button> <button @tap="goCustomNavigation" class="uni-btn">
<button @tap="goCustomNavigation" class="uni-btn"> 跳转自定义导航栏页面
跳转自定义导航栏页面 </button>
</button>
</view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head title="setNavigationBarTitle"></page-head>
<page-head title="setNavigationBarTitle"></page-head> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-padding-wrap uni-common-mt"> <button @tap="setNavigationBarNewTitle" class="uni-btn">
<button @tap="setNavigationBarNewTitle" class="uni-btn"> 设置当前页面标题为: {{ newTitle }}
设置当前页面标题为: {{ newTitle }} </button>
</button> <button @tap="setNavigationBarLongTitle" class="uni-btn">
<button @tap="setNavigationBarLongTitle" class="uni-btn"> 设置超长标题
设置超长标题 </button>
</button>
</view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head title="websocket通讯示例"></page-head>
<page-head title="websocket通讯示例"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <view class="uni-btn-v">
<view class="uni-btn-v"> <text class="websocket-msg">{{ showMsg }}</text>
<text class="websocket-msg">{{ showMsg }}</text> <button class="uni-btn-v" type="primary" @click="connect">
<button class="uni-btn-v" type="primary" @click="connect"> 连接websocket服务
连接websocket服务 </button>
</button> <button class="uni-btn-v" v-show="connected" type="primary" @click="send">
<button class="uni-btn-v" v-show="connected" type="primary" @click="send"> 发送一条消息
发送一条消息 </button>
</button> <button class="uni-btn-v" type="primary" @click="close">
<button class="uni-btn-v" type="primary" @click="close"> 断开websocket服务
断开websocket服务 </button>
</button> <text class="websocket-tips">发送消息后会收到一条服务器返回的消息(与发送的消息内容一致)</text>
<text class="websocket-tips">发送消息后会收到一条服务器返回的消息(与发送的消息内容一致)</text>
</view>
</view> </view>
</view> </view>
</template> </template>
......
<template> <template>
<view> <page-head title="websocket通讯示例"></page-head>
<page-head title="websocket通讯示例"></page-head> <view class="uni-padding-wrap">
<view class="uni-padding-wrap"> <view class="uni-btn-v">
<view class="uni-btn-v"> <text class="websocket-msg">{{ showMsg }}</text>
<text class="websocket-msg">{{ showMsg }}</text> <button class="uni-btn-v" type="primary" @click="connect">
<button class="uni-btn-v" type="primary" @click="connect"> 连接websocket服务
连接websocket服务 </button>
</button> <button class="uni-btn-v" v-show="connected" type="primary" @click="send">
<button class="uni-btn-v" v-show="connected" type="primary" @click="send"> 发送一条消息
发送一条消息 </button>
</button> <button class="uni-btn-v" type="primary" @click="close">
<button class="uni-btn-v" type="primary" @click="close"> 断开websocket服务
断开websocket服务 </button>
</button> <text class="websocket-tips">发送消息后会收到一条服务器返回的消息(与发送的消息内容一致)</text>
<text class="websocket-tips">发送消息后会收到一条服务器返回的消息(与发送的消息内容一致)</text>
</view>
</view> </view>
</view> </view>
</template> </template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册