-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
159 changed files
with
735 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
examples/mini-program-example/src/pages/api/basics/nativeDebug/index.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
navigationBarTitleText: '基础-调试', | ||
} |
6 changes: 6 additions & 0 deletions
6
examples/mini-program-example/src/pages/api/basics/nativeDebug/index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@import "@/styles/variables.scss"; | ||
|
||
.test-style { | ||
color: #f5f5f5; | ||
background-color: $color-success; | ||
} |
146 changes: 146 additions & 0 deletions
146
examples/mini-program-example/src/pages/api/basics/nativeDebug/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
import React from 'react' | ||
import Taro from '@tarojs/taro' | ||
import { View, Text } from '@tarojs/components' | ||
import ButtonList from '@/components/buttonList' | ||
import './index.scss' | ||
import { TestConsole } from '@/util/util' | ||
|
||
/** | ||
* 基础-调试 | ||
* @returns | ||
*/ | ||
let realtimeLogManager | ||
let logManager | ||
export default class Index extends React.Component { | ||
state = { | ||
list: [ | ||
{ | ||
id: 'setEnableDebug', | ||
func: () => { | ||
TestConsole.consoleTest('setEnableDebug') | ||
Taro.setEnableDebug({ | ||
enableDebug: true, | ||
success(res) { | ||
TestConsole.consoleSuccess(res) | ||
}, | ||
fail(res) { | ||
TestConsole.consoleFail(res) | ||
}, | ||
complete(res) { | ||
TestConsole.consoleComplete(res) | ||
}, | ||
}).then((res) => { | ||
TestConsole.consoleResult(res) | ||
}) | ||
}, | ||
}, | ||
{ | ||
id: 'getRealtimeLogManager', | ||
func: () => { | ||
realtimeLogManager = Taro.getRealtimeLogManager() | ||
TestConsole.consoleNormal('setEnableDebug', realtimeLogManager) | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-addFilterMsg', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-addFilterMsg') | ||
realtimeLogManager.addFilterMsg('test') | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-in', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-in') | ||
realtimeLogManager.in(Taro.getCurrentPages()) | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-error', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-error') | ||
realtimeLogManager.error('test', ['test']) | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-info', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-info') | ||
realtimeLogManager.info(['test']) | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-setFilterMsg', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-setFilterMsg') | ||
realtimeLogManager.setFilterMsg('test') | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-warn', | ||
func: () => { | ||
TestConsole.consoleNormal('RealtimeLogManager-warn') | ||
realtimeLogManager.warn('test', ['test']) | ||
}, | ||
}, | ||
{ | ||
id: 'RealtimeLogManager-tag', | ||
func: () => { | ||
let realtimeTagLogManage = realtimeLogManager.tag('test') | ||
TestConsole.consoleNormal('RealtimeLogManager-tag', realtimeTagLogManage) | ||
}, | ||
}, | ||
{ | ||
id: 'getLogManager', | ||
func: () => { | ||
logManager = Taro.getLogManager() | ||
TestConsole.consoleNormal('getLogManager', logManager) | ||
}, | ||
}, | ||
{ | ||
id: 'LogManager-debug', | ||
func: () => { | ||
logManager.debug(['test']) | ||
TestConsole.consoleNormal('LogManager-debug') | ||
}, | ||
}, | ||
{ | ||
id: 'LogManager-info', | ||
func: () => { | ||
logManager.info(['test']) | ||
TestConsole.consoleNormal('LogManager-info') | ||
}, | ||
}, | ||
{ | ||
id: 'LogManager-log', | ||
func: () => { | ||
logManager.log(['test']) | ||
TestConsole.consoleNormal('LogManager-log') | ||
}, | ||
}, | ||
{ | ||
id: 'LogManager-warn', | ||
func: () => { | ||
logManager.warn(['test']) | ||
TestConsole.consoleNormal('LogManager-warn') | ||
}, | ||
}, | ||
{ | ||
id: 'console', | ||
func: null, | ||
}, | ||
{ | ||
id: 'RealtimeTagLogManager', | ||
func: null, | ||
}, | ||
], | ||
} | ||
render() { | ||
const { list } = this.state | ||
return ( | ||
<View className='api-page'> | ||
<ButtonList buttonList={list} /> | ||
</View> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,5 +76,4 @@ describe('pxtransform', () => { | |
}) | ||
expect(Taro.pxTransform(20)).toBe('0.585rem') | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.