提交 18126b9d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

style: uniform indent

上级 ba131b3e
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
import { State, state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State, _state: state as State,
lifeCycleNum: 0, lifeCycleNum: 0,
} }
}, },
onReady() { onReady() {
this.lifeCycleNum = state.lifeCycleNum this.lifeCycleNum = state.lifeCycleNum
}, },
methods: { methods: {
_increasetLifeCycleNum: function () { _increasetLifeCycleNum: function () {
const app = getApp() const app = getApp()
......
<template> <template>
<view> <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> </view>
<text class="uni-common-mt font-size-20">非全局加载字体:</text> <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 class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiTTF">font-family: 阿里妈妈刀隶体-ttf
(网络字体下载后生效)</text> (网络字体下载后生效)</text>
<text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family: <text class="font-size-20 line-height-40" style="font-family: AlimamaDaoLiTiOTF">font-family:
阿里妈妈刀隶体-otf</text> 阿里妈妈刀隶体-otf</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF">font-family: 阿里妈妈刀隶体-woff</text> <text class="item" style="font-family: AlimamaDaoLiTiWOFF">font-family: 阿里妈妈刀隶体-woff</text>
<text class="item" style="font-family: AlimamaDaoLiTiWOFF2">font-family: 阿里妈妈刀隶体-woff2</text> <text class="item" style="font-family: AlimamaDaoLiTiWOFF2">font-family: 阿里妈妈刀隶体-woff2</text>
<button class="uni-btn" @click="navigateToChild">跳转子页面测试字体生效范围</button> <button class="uni-btn" @click="navigateToChild">跳转子页面测试字体生效范围</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
uniIcon1: '\ue100', uniIcon1: '\ue100',
uniIcon2: '\ue101', uniIcon2: '\ue101',
} }
}, },
onLoad() { onLoad() {
uni.loadFontFace({ uni.loadFontFace({
global: true, global: true,
family: 'UniFontFamily', family: 'UniFontFamily',
source: '/static/font/uni.ttf', source: '/static/font/uni.ttf',
success() { success() {
console.log('global loadFontFace uni.ttf success') console.log('global loadFontFace uni.ttf success')
}, },
fail(error) { fail(error) {
console.warn('global loadFontFace uni.ttf fail', error.errMsg) console.warn('global loadFontFace uni.ttf fail', error.errMsg)
}, },
}) })
uni.loadFontFace({ uni.loadFontFace({
family: 'AlimamaDaoLiTiTTF', family: 'AlimamaDaoLiTiTTF',
source: source:
'https://native-res.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf', 'https://native-res.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf',
success() { success() {
console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success') console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')
}, },
fail(error) { fail(error) {
console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg) console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)
}, },
}) })
uni.loadFontFace({ uni.loadFontFace({
family: 'AlimamaDaoLiTiOTF', family: 'AlimamaDaoLiTiOTF',
source: '/static/font/AlimamaDaoLiTi.otf', source: '/static/font/AlimamaDaoLiTi.otf',
success() { success() {
console.log('loadFontFace AlimamaDaoLiTi.otf success') console.log('loadFontFace AlimamaDaoLiTi.otf success')
}, },
fail(error) { fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg) console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)
}, },
}) })
uni.loadFontFace({ uni.loadFontFace({
family: 'AlimamaDaoLiTiWOFF', family: 'AlimamaDaoLiTiWOFF',
source: '/static/font/AlimamaDaoLiTi.woff', source: '/static/font/AlimamaDaoLiTi.woff',
success() { success() {
console.log('loadFontFace AlimamaDaoLiTi.woff success') console.log('loadFontFace AlimamaDaoLiTi.woff success')
}, },
fail(error) { fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg) console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)
}, },
}) })
uni.loadFontFace({ uni.loadFontFace({
family: 'AlimamaDaoLiTiWOFF2', family: 'AlimamaDaoLiTiWOFF2',
source: '/static/font/AlimamaDaoLiTi.woff2', source: '/static/font/AlimamaDaoLiTi.woff2',
success() { success() {
console.log('loadFontFace AlimamaDaoLiTi.woff2 success') console.log('loadFontFace AlimamaDaoLiTi.woff2 success')
}, },
fail(error) { fail(error) {
console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg) console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)
}, },
}) })
}, },
methods: { methods: {
navigateToChild() { navigateToChild() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/API/load-font-face/load-font-face-child', url: '/pages/API/load-font-face/load-font-face-child',
}) })
}, },
}, },
} }
</script> </script>
<style> <style>
.font-size-20 { .font-size-20 {
font-size: 20px; font-size: 20px;
} }
.line-height-40 { .line-height-40 {
line-height: 40px; line-height: 40px;
} }
</style> </style>
\ No newline at end of file
...@@ -57,9 +57,9 @@ ...@@ -57,9 +57,9 @@
import { State, state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State, _state: state as State,
onLoadTime: 0, onLoadTime: 0,
onShowTime: 0, onShowTime: 0,
onReadyTime: 0, onReadyTime: 0,
......
...@@ -15,73 +15,73 @@ ...@@ -15,73 +15,73 @@
import { State, state, setLifeCycleNum } from '@/store/index.uts' import { State, state, setLifeCycleNum } from '@/store/index.uts'
export default { export default {
data() { data() {
return { return {
_state: state as State, _state: state as State,
isScrolled: false, isScrolled: false,
} }
}, },
onLoad(_ : OnLoadOptions) { onLoad(_ : OnLoadOptions) {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
}, },
onShow() { onShow() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onReady() { onReady() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onPullDownRefresh() { onPullDownRefresh() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onPageScroll(_) { onPageScroll(_) {
// 自动化测试 // 自动化测试
this.isScrolled = true this.isScrolled = true
}, },
onReachBottom() { onReachBottom() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum + 10) setLifeCycleNum(state.lifeCycleNum + 10)
}, },
onBackPress(_ : OnBackPressOptions) : boolean | null { onBackPress(_ : OnBackPressOptions) : boolean | null {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
return null return null
}, },
onHide() { onHide() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 10) setLifeCycleNum(state.lifeCycleNum - 10)
}, },
onUnload() { onUnload() {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
}, },
methods: { methods: {
// 自动化测试 // 自动化测试
getLifeCycleNum() : number { getLifeCycleNum() : number {
return state.lifeCycleNum return state.lifeCycleNum
}, },
// 自动化测试 // 自动化测试
setLifeCycleNum(num : number) { setLifeCycleNum(num : number) {
setLifeCycleNum(num) setLifeCycleNum(num)
}, },
pullDownRefresh() { pullDownRefresh() {
uni.startPullDownRefresh({ uni.startPullDownRefresh({
success() { success() {
setTimeout(() => { setTimeout(() => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}, 1000) }, 1000)
}, },
}) })
}, },
scrollToBottom() { scrollToBottom() {
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: 2000, scrollTop: 2000,
}) })
}, },
}, },
} }
</script> </script>
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
<text class="common" style="font-family: AlimamaDaoLiTiTTF" <text class="common" style="font-family: AlimamaDaoLiTiTTF"
>font-family: 阿里妈妈刀隶体-ttf(网络字体下载后生效)</text >font-family: 阿里妈妈刀隶体-ttf(网络字体下载后生效)</text
> >
<!-- <text class="common" style="font-family: AlimamaDaoLiTiOTF" <!-- <text class="common" style="font-family: AlimamaDaoLiTiOTF"
>font-family: 阿里妈妈刀隶体-otf</text >font-family: 阿里妈妈刀隶体-otf</text
> >
<text class="common" style="font-family: AlimamaDaoLiTiWOFF" <text class="common" style="font-family: AlimamaDaoLiTiWOFF"
>font-family: 阿里妈妈刀隶体-woff</text >font-family: 阿里妈妈刀隶体-woff</text
> >
<text class="common" style="font-family: AlimamaDaoLiTiWOFF2" <text class="common" style="font-family: AlimamaDaoLiTiWOFF2"
>font-family: 阿里妈妈刀隶体-woff2</text >font-family: 阿里妈妈刀隶体-woff2</text
> --> > -->
</view> </view>
......
...@@ -144,20 +144,20 @@ export default { ...@@ -144,20 +144,20 @@ export default {
open: false, open: false,
pages: [ pages: [
/* { /* {
name: "创建动画", name: "创建动画",
url: "animation", url: "animation",
enable: false enable: false
}, },
{ {
name: "创建绘画", name: "创建绘画",
url: "canvas", url: "canvas",
enable: false enable: false
}, },
{ {
name: "节点布局交互状态", name: "节点布局交互状态",
url: "intersection-observer", url: "intersection-observer",
enable: false enable: false
}, */ }, */
{ {
name: '节点信息', name: '节点信息',
url: 'nodes-info', url: 'nodes-info',
...@@ -222,57 +222,57 @@ export default { ...@@ -222,57 +222,57 @@ export default {
url: 'get-battery-info', url: 'get-battery-info',
}, },
/* { /* {
name: "打电话", name: "打电话",
url: "make-phone-call", url: "make-phone-call",
}, },
{ {
name: "震动", name: "震动",
url: "vibrate", url: "vibrate",
}, },
{ {
name: "添加手机联系人", name: "添加手机联系人",
url: "add-phone-contact", url: "add-phone-contact",
}, },
{ {
name: "扫码", name: "扫码",
url: "scan-code", url: "scan-code",
}, },
{ {
name: "剪贴板", name: "剪贴板",
url: "clipboard", url: "clipboard",
}, },
{ {
name: "屏幕亮度", name: "屏幕亮度",
url: "brightness", url: "brightness",
}, },
{ {
name: "蓝牙", name: "蓝牙",
url: "bluetooth", url: "bluetooth",
}, },
{ {
name: "生物认证", name: "生物认证",
url: "soter", url: "soter",
}, },
{ {
name: "iBeacon", name: "iBeacon",
url: "ibeacon", url: "ibeacon",
}, },
{ {
name: "监听加速度传感器", name: "监听加速度传感器",
url: "on-accelerometer-change", url: "on-accelerometer-change",
}, },
{ {
name: "监听罗盘数据", name: "监听罗盘数据",
url: "on-compass-change", url: "on-compass-change",
}, },
{ {
name: "监听距离传感器", name: "监听距离传感器",
url: "/platforms/app-plus/proximity/proximity", url: "/platforms/app-plus/proximity/proximity",
}, },
{ {
name: "监听方向传感器", name: "监听方向传感器",
url: "/platforms/app-plus/orientation/orientation", url: "/platforms/app-plus/orientation/orientation",
}, */ }, */
] as Page[], ] as Page[],
}, },
{ {
...@@ -319,34 +319,34 @@ export default { ...@@ -319,34 +319,34 @@ export default {
url: 'preview-image', url: 'preview-image',
}, },
/* { /* {
name: "图片选择和拍照", name: "图片选择和拍照",
url: "image", url: "image",
enable: false enable: false
},{ },{
name: "音频", name: "音频",
url: "inner-audio", url: "inner-audio",
}, },
{ {
name: "录音", name: "录音",
url: "voice", url: "voice",
}, },
{ {
name: "背景音频", name: "背景音频",
url: "background-audio", url: "background-audio",
}, },
{ {
name: "视频选择和拍照", name: "视频选择和拍照",
url: "video", url: "video",
enable: false enable: false
}, },
{ {
name: "文件", name: "文件",
url: "file", url: "file",
}, },
{ {
name: "保存媒体到本地", name: "保存媒体到本地",
url: "save-media", url: "save-media",
}, */ }, */
] as Page[], ] as Page[],
}, },
{ {
...@@ -359,21 +359,21 @@ export default { ...@@ -359,21 +359,21 @@ export default {
url: 'get-location', url: 'get-location',
}, },
/* { /* {
name: "使用地图查看位置", name: "使用地图查看位置",
url: "open-location", url: "open-location",
}, },
{ {
name: "使用地图选择位置", name: "使用地图选择位置",
url: "choose-location", url: "choose-location",
}, },
{ {
name: "地图控制", name: "地图控制",
url: "map", url: "map",
}, },
{ {
name: "地图搜索", name: "地图搜索",
url: "map-search", url: "map-search",
}, */ }, */
] as Page[], ] as Page[],
}, },
{ {
...@@ -388,80 +388,80 @@ export default { ...@@ -388,80 +388,80 @@ export default {
] as Page[], ] as Page[],
}, },
/* { /* {
id: "rewarded-video-ad", id: "rewarded-video-ad",
url: "rewarded-video-ad", url: "rewarded-video-ad",
name: "激励视频广告", name: "激励视频广告",
open: false, open: false,
enable: false, enable: false,
pages: [] as Page[] pages: [] as Page[]
}, },
{ {
id: "full-screen-video-ad", id: "full-screen-video-ad",
url: "full-screen-video-ad", url: "full-screen-video-ad",
name: "全屏视频广告", name: "全屏视频广告",
open: false, open: false,
enable: false, enable: false,
pages: [] as Page[] pages: [] as Page[]
}, },
{ {
id: "login", id: "login",
name: "登录", name: "登录",
open: false, open: false,
pages: [ pages: [
{ {
name: "登录", name: "登录",
url: "login", url: "login",
}, },
{ {
name: "获取用户信息", name: "获取用户信息",
url: "get-user-info", url: "get-user-info",
}, },
] as Page[], ] as Page[],
}, },
{ {
id: "share", id: "share",
name: "分享", name: "分享",
open: false, open: false,
pages: [ pages: [
{ {
name: "分享", name: "分享",
url: "share", url: "share",
}, },
] as Page[], ] as Page[],
}, },
{ {
id: "payment", id: "payment",
name: "支付", name: "支付",
open: false, open: false,
pages: [ pages: [
{ {
name: "发起支付", name: "发起支付",
url: "request-payment", url: "request-payment",
}, },
] as Page[], ] as Page[],
}, },
{ {
id: "speech", id: "speech",
name: "语音", name: "语音",
open: false, open: false,
pages: [ pages: [
{ {
name: "语音识别", name: "语音识别",
url: "/platforms/app-plus/speech/speech", url: "/platforms/app-plus/speech/speech",
}, },
] as Page[], ] as Page[],
}, },
{ {
id: "push", id: "push",
name: "推送", name: "推送",
open: false, open: false,
pages: [ pages: [
{ {
name: "推送", name: "推送",
url: "/platforms/app-plus/push/push", url: "/platforms/app-plus/push/push",
}, },
] as Page[], ] as Page[],
}, */ }, */
{ {
id: 'exit', id: 'exit',
name: '退出', name: '退出',
......
...@@ -96,15 +96,15 @@ export default { ...@@ -96,15 +96,15 @@ export default {
name: 'swiper', name: 'swiper',
}, },
/* /*
{ {
name: 'movable-view', name: 'movable-view',
enable: false enable: false
}, },
{ {
name: 'cover-view', name: 'cover-view',
enable: false enable: false
}, },
*/ */
{ {
name: 'list(新闻)', name: 'list(新闻)',
url: '/pages/component/list/list', url: '/pages/component/list/list',
...@@ -144,17 +144,17 @@ export default { ...@@ -144,17 +144,17 @@ export default {
name: 'checkbox', name: 'checkbox',
}, },
/* { /* {
name: 'form', name: 'form',
enable: false enable: false
}, */ }, */
{ {
name: 'input', name: 'input',
/* }, { /* }, {
name: 'label', name: 'label',
enable: false enable: false
}, { }, {
name: 'picker', name: 'picker',
enable: false */ enable: false */
}, },
{ {
name: 'picker-view', name: 'picker-view',
...@@ -175,20 +175,20 @@ export default { ...@@ -175,20 +175,20 @@ export default {
name: 'textarea', name: 'textarea',
}, },
/* /*
{ {
name: 'editor', name: 'editor',
enable: false enable: false
}, },
*/ */
] as Page[], ] as Page[],
/* }, { /* }, {
id: 'nav', id: 'nav',
name: '导航', name: '导航',
open: false, open: false,
pages: [{ pages: [{
name: 'navigator', name: 'navigator',
enable: false enable: false
}] as Page[] */ }] as Page[] */
}, },
{ {
id: 'media', id: 'media',
...@@ -210,28 +210,28 @@ export default { ...@@ -210,28 +210,28 @@ export default {
] as Page[], ] as Page[],
}, },
/* /*
{ {
id: 'map', id: 'map',
name: '地图', name: '地图',
open: false, open: false,
pages: [ pages: [
{ {
name: 'map', name: 'map',
enable: false enable: false
} }
] as Page[] ] as Page[]
}, },
{ {
id: 'canvas', id: 'canvas',
name: '画布', name: '画布',
open: false, open: false,
pages: [ pages: [
{ {
name: 'canvas' name: 'canvas'
} }
] as Page[] ] as Page[]
}, },
*/ */
{ {
id: 'web-view', id: 'web-view',
name: '网页', name: '网页',
...@@ -250,15 +250,15 @@ export default { ...@@ -250,15 +250,15 @@ export default {
] as Page[], ] as Page[],
}, },
/* /*
{ {
id: 'ad', id: 'ad',
url: 'ad', url: 'ad',
name: 'AD组件', name: 'AD组件',
enable: false, enable: false,
open: false, open: false,
pages: [] as Page[] pages: [] as Page[]
} }
*/ */
{ {
id: 'general-attr-event', id: 'general-attr-event',
name: '通用属性和事件', name: '通用属性和事件',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册