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

style: uniform indent

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