Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复api账户信息的组件引用错误 #153

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ export default class Index extends React.Component<Props, States> {
textareaControl,
})
}

isAdvancedAPI = (APIName) => {
// @ts-ignore
return asAPIMap.get(APIName) || native[APIName]
}
render() {
const { buttonList } = this.props
const { inputData, textareaControl, hiddenNum } = this.state
Expand Down Expand Up @@ -150,7 +155,7 @@ export default class Index extends React.Component<Props, States> {
)}
<View
className={`api-page-btn ${item.func == null ? 'api-page-btn-uncreate' : ''} ${
item.advancedAPI ? 'api-page-btn-advanced' : ''
this.isAdvancedAPI(item.id) ? 'api-page-btn-advanced' : ''
}`}
id={item.id}
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import Taro from '@tarojs/taro'
import { View, Button, Text } from '@tarojs/components'
import ButtonList from '@/components/buttonList'
import './index.scss'

/**
Expand All @@ -10,19 +11,18 @@ import './index.scss'

export default class Index extends React.Component {
state = {
api: {
id: 'getAccountInfoSync',
func: null,
},
list: [
{
id: 'getAccountInfoSync',
func: null,
},
],
}
render() {
const { api } = this.state
const { list } = this.state
return (
<View className='api-page'>
<View key={api.id} className='api-page-btn' onClick={api.func == null ? () => {} : api.func}>
{api.id}
{api.func == null && <Text className='navigator-state tag'>未创建Demo</Text>}
</View>
<ButtonList buttonList={list} />
</View>
)
}
Expand Down