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
微信小程序
https://github.com/Miaonster/demo-taro-next-nest-view 小程序基础库: 2.12.1 使用框架: React
在我给出的 demo 中,src/page/index/index.jsx 中使用嵌套 16 层以上的 View 后,在微信开发者工具中,查看 dom 结构,会发现 <View> 出现 <comp is="comp"> 在之中
<View>
<comp is="comp">
import React, { Component } from 'react' import { View, Text } from '@tarojs/components' import './index.css' export default class Index extends Component { render () { return ( <View className='index'> <Text>Hello world!</Text> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> <View> haha </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> </View> ) } }
期望正常渲染成 view,而不是嵌套在 <comp is="comp"> 李
实际会嵌套一层 <comp is="comp">
👽 Taro v3.0.7 Taro CLI 3.0.7 environment info: System: OS: macOS 10.15.5 Shell: 3.0.2 - /usr/local/bin/fish Binaries: Node: 14.3.0 - ~/.config/nvm/14.3.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - ~/.config/nvm/14.3.0/bin/npm npmPackages: @tarojs/components: 3.0.7 => 3.0.7 @tarojs/mini-runner: 3.0.7 => 3.0.7 @tarojs/react: 3.0.7 => 3.0.7 @tarojs/runtime: 3.0.7 => 3.0.7 @tarojs/taro: 3.0.7 => 3.0.7 @tarojs/webpack-runner: 3.0.7 => 3.0.7 babel-preset-taro: 3.0.7 => 3.0.7 eslint-config-taro: 3.0.7 => 3.0.7 react: ^16.10.0 => 16.13.1
The text was updated successfully, but these errors were encountered:
故意的,借用自定义组件重新开始 template 递归
Sorry, something went wrong.
@Chen-jj 多加一层元素可能会导致样式有问题,比如在最后一层使用 flex 布局,如果正好给子元素增加一个 <comp> ,flex 布局就无法正确使用,这种情况改怎么解决呢?
<comp>
有一个配置项, mini.baselevel 好像是,可以配置默认层数,可以去文档配置详情找找。层数太多,包越大,小心使用
好的,感谢 👍
No branches or pull requests
相关平台
微信小程序
复现仓库
https://github.com/Miaonster/demo-taro-next-nest-view
小程序基础库: 2.12.1
使用框架: React
复现步骤
在我给出的 demo 中,src/page/index/index.jsx 中使用嵌套 16 层以上的 View 后,在微信开发者工具中,查看 dom 结构,会发现
<View>
出现<comp is="comp">
在之中期望结果
期望正常渲染成 view,而不是嵌套在
<comp is="comp">
李实际结果
实际会嵌套一层
<comp is="comp">
环境信息
The text was updated successfully, but these errors were encountered: