Comments (3)
OpenData 只有 AtAvatar 用到。这个报错影响程序正常运行么?
from taro-ui-vue3.
不影响运行也不应当这样报错 吧
from taro-ui-vue3.
其他没有 OpenData
组件的小程序平台使用时会报错,是因为 AtAvatar
从 @tarojs/components
中明确引用了 OpenData
组件:
import { Image, OpenData, Text, View } from '@tarojs/components'
两个办法:
- 如果不使用
AtAvatar
组件,不要引用就行了。请按需引用其他组件。
// 这样会引用全部组件,包括 AtAvatar。
import { createUI } from 'taro-ui-vue3'
const tuv3 = createUI()
...
App.use(tuv3)
- 如果要使用
AtAvatar
组件,请自行修改。- 不要从
@tarojs/components
引用OpenData
- 使用
vue
的resolveComponent
函数来解析OpenData
组件
- 不要从
const children = isWEAPP && props.openData && props.openData.type === 'userAvatarUrl'
? h(resolveComponent('open-data'), { type: props.openData.type })
: props.image
? h(Image, { class: 'at-avatar__img', src: props.image })
: h(Text, { class: 'at-avatar__text' }, { default: () => letter.value })
from taro-ui-vue3.
Related Issues (20)
- 请问下 自定义的文件夹无法在 tsconfig.json设置别名吗? HOT 1
- List item onClick/onSwitchChange 应该是action不是props HOT 3
- Taro2.x还是Taro3.x HOT 2
- imagepicker @image-pick=H5图片点击放大效果不生效 HOT 2
- VirtualScroll :itemHeight 单位固定成为了px,无法适配小程序 HOT 3
- '@tarojs/components' does not contain an export named 'View'.
- 如何使用AtTabBar作为自定义tabbar HOT 1
- class多级嵌套下,报错TypeError: insertionPoint.insertAdjacentHTML is not a function HOT 3
- 希望VirtualScroll增加一个列表数据为空的时候显示的结构 HOT 2
- 停止维护通知
- 关于滑动条范围选择组件AtRange小程序模拟器/真机演示不能拖动选择的问题 HOT 3
- 兄弟们 Taroify 也是一个不错的选择
- SwipeAction 第一次触发无反应 HOT 4
- at-search-bar组件的onClear事件无效 HOT 5
- SearchBar怎么一点击搜索那个文字就自动清空了的? HOT 2
- Taro Vue 3.0 报错: SVGElement is not defined HOT 6
- AtSwipeAction 出现相同的id swipeAction-2020 HOT 2
- `AtFloatLayout` 组件滚动穿透问题。 HOT 2
- 全局引入报错 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taro-ui-vue3.