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

更新API示例

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