b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

AtToast 的 isOpened 一开始为true时,报TypeError: Cannot set property '_timer' of undefined和TypeError: Cannot read property '_isOpened' of undefined错 #80

Closed domsgit closed 3 years ago

domsgit commented 3 years ago

问题描述

进入页面请求接口,先需要设置 AtToast 为 loading 的状态,但是 当设置 isOpened 为true时,组件报错。

版本信息

v1.0.0-alpha.17

涉及的平台

weapp

错误信息

// error message here
TypeError: Cannot set property '_timer' of undefined
TypeError: Cannot read property '_isOpened' of undefined

代码

// code here
<template>
  <AtToast :isOpened="true" :text="'正在加载中'" :status="'loading'"></AtToast>
</template>

<script setup lang="ts">
import { AtToast } from 'taro-ui-vue3'
</script>
domsgit commented 3 years ago

补充:克隆下该仓库的源码后试了一下没问题。就是使用编译后发布的版本的taro-ui-vue3就会有这个报错。

b2nil commented 3 years ago

@domsgit 这个问题已经修复了(e3c3dc43f66e1332c042c81ab9774d0447b79736),但是好像忘记了发新版,抱歉。 今天晚上发一个新的版本。

domsgit commented 3 years ago

@domsgit 这个问题已经修复了(e3c3dc4),但是好像忘记了发新版,抱歉。 今天晚上发一个新的版本。

直接用下面的方式替代也没有这个问题了。而且不用在template中添加代码。

Taro.showToast({ title:加载数据中..., icon: 'loading', duration: 0 })