We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
百度小程序
小程序基础库: 3.190.255 使用框架: React
1、ComponentB import React from 'react' import { View } from '@tarojs/components'
import './ComponentB.scss'
export function ComponentB({tabView}) {
return ( from page A {tabView()} -----------self self4 self5 self6 ) }
2、ComponentB.scss .flex-view { display: flex; flex-direction: row; justify-content: space-between; }
3、PageA import React from 'react' import { View, Block } from '@tarojs/components' import {ComponentB} from './ComponentB'
const PageA = () => { const tabView = () => ( // 解决办法:把flex-view放到这里 // pagea1 pagea2 pagea3 )
return ( ) }
export default PageA
PageA中 tabView函数组件的3个View也能水平排列 微信小程序是正常的。
PageA中 tabView函数组件的3个View仍然是垂直排列,控制不了。
Taro v3.0.2 Taro CLI 3.0.2 environment info: System: OS: Windows 7 Binaries: Node: 12.16.1 - D:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Users\Think\AppData\Roaming\npm\yarn.CMD npm: 6.14.5 - D:\Program Files\nodejs\npm.CMD
自己的临时解决方法:把 从ComponentB中,移到PageA的tabView函数组件中。
The text was updated successfully, but these errors were encountered:
` 1-ComponentB.tsx import React from 'react' import { View } from '@tarojs/components'
2-ComponentB.scss .flex-view, .flex-view2 { display: flex; flex-direction: row; justify-content: space-between; }
3-PageA.tsx import React from 'react' import { View, Block } from '@tarojs/components' import {ComponentB} from './ComponentB'
`
Sorry, something went wrong.
@aidisheng 请提供可运行可复现的代码,并整理好你的代码格式
没有清晰能运行的代码,无法定位
No branches or pull requests
相关平台
百度小程序
小程序基础库: 3.190.255
使用框架: React
复现步骤
1、ComponentB
import React from 'react'
import { View } from '@tarojs/components'
import './ComponentB.scss'
export function ComponentB({tabView}) {
return (
from page A
{tabView()}
-----------self
self4
self5
self6
)
}
2、ComponentB.scss
.flex-view {
display: flex;
flex-direction: row;
justify-content: space-between;
}
3、PageA
import React from 'react'
import { View, Block } from '@tarojs/components'
import {ComponentB} from './ComponentB'
const PageA = () => {
const tabView = () => (
// 解决办法:把flex-view放到这里
//
pagea1
pagea2
pagea3
)
return (
)
}
export default PageA
期望结果
PageA中 tabView函数组件的3个View也能水平排列
微信小程序是正常的。
实际结果
PageA中 tabView函数组件的3个View仍然是垂直排列,控制不了。
环境信息
补充信息
自己的临时解决方法:把 从ComponentB中,移到PageA的tabView函数组件中。
The text was updated successfully, but these errors were encountered: