Giter VIP home page Giter VIP logo

taro-ui-vue3's People

Contributors

b2nil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

taro-ui-vue3's Issues

[H5] AtSearchBar 点击搜索按钮后,不能彻底清空搜索内容

问题描述

通过 onActionClick 重置 AtSearchBarvalue,不能将视图层节点的 value 彻底清除。

版本信息

v1.0.0-alpha.8

涉及的平台

h5

代码

// template
<at-search-bar
   placeholder="跳转到指定Key"
   :value="searchbarValue"
   @change="handleChange"
   @action-click="handleActionClick"
/>
// script
const searchbarValue = ref('')

function handleActionClick() {
  searchbarValue.value = ''
}

Calendar 组件不能选取日期

日历组件无法选取日期。

排查问题时发现:

  • date-list/index.ts: 滑动月份时,每个日期会自动触发一次 handleClick
  • AtCalendarDateList, onTap 或 onClick 的使用问题
    • 如果使用 onTap, 回调函数的参数传回的是 TaroEvent,无法获取到 Calendar.Item 的参数,导致无法选取日期
    • 如果使用 OnClick,回调函数能够正常传回日历参数 Calendar.Item,但是会无限触发 props.onDayClick

问题复现 repo: taro-vue3-calendar

h5 taro-xxx-core 组件点击时会被隐藏

编译到 h5 后,点击部分监听事件的 taro-xxx-core 组件后,组件样式会被设置为 visibility: hidden
受影响的组件包括: AtCalendar, AtCheckBox 等等……

AtCalendar 组件滑动切换月份,意外回到上个月份

问题描述

当切换月份时,在monthChange方法中修改页面中的变量,触发页面重新渲染,这时会又跳到刚才切换之前的月份

版本信息

v1.0.0-alpha.12

涉及的平台

weapp

错误信息

代码

<at-calendar @monthChange="monthChange" />
<view class="part-loading" v-if="partLoading">
  <at-activity-indicator></at-activity-indicator>
</view>
const partLoading = ref(false)

const monthChange = (value) => {
  partLoading.value = true
}

AtTabs 不能显示 slot 内容

问题描述

AtTabs 不能正常显示 slot 内容,小程序开发工具报:[Vue warn]: Invalid VNode type: undefined (undefined)

版本信息

v1.0.0-alpha.7

涉及的平台

小程序、H5

错误信息

VM213:1 [Vue warn]: Invalid VNode type: undefined (undefined) 
  at <AtTabs current=0 animated=false tab-list= (3) [{…}, {…}, {…}]  ... > 
  at <Panel no-padding="" title="禁止内容切换动画" > 
  at <Page header-title="Tabs 标签页" > 
  at <TabsDemo tid="pages/navigation/tabs/index?__key_=16026424669982" > 
  at <App>

关于按需引用组件的说明

如需按需引用组件,请从 taro-ui-vue3/lib 目录中引用。
样式按需引用,仍需从 taro-ui-vue3/dist/style 目录中引用。

方式一

import { AtButton } from 'taro-ui-vue3/lib'
import "taro-ui-vue3/dist/style/components/button.scss"

方式二

  • 在 webpack 配置中,将 taro-ui-vue3 的 alias 指向 taro-ui-vue3/lib
// config/index.js
alias: {
  'taro-ui-vue3$': 'taro-ui-vue3/lib'
}
  • 然后从 taro-ui-vue3 中引用组件
 import { AtButton } from 'taro-ui-vue3'
 import "taro-ui-vue3/dist/style/components/button.scss"

Card 展示页面返回时报错

AtCard 的自定义图标展示中:<at-card :renderIcon="renderIcon()">...</at-card>,
renderIcon 属性绑定的数据是一个匿名函数: const renderIcon = () => h(AtIcon, {...})
导致页面返回销毁组件时报错:

VM457:1 TypeError: Cannot read property 'bum' of null
    at unmountComponent (runtime-core.esm-bundler.js:4632)
    at unmount (runtime-core.esm-bundler.js:4549)
    at unmountChildren (runtime-core.esm-bundler.js:4681)
    at unmount (runtime-core.esm-bundler.js:4564)
    at unmountComponent (runtime-core.esm-bundler.js:4646)
    at unmount (runtime-core.esm-bundler.js:4549)
    at unmountChildren (runtime-core.esm-bundler.js:4681)
    at unmount (runtime-core.esm-bundler.js:4567)
    at patchKeyedChildren (runtime-core.esm-bundler.js:4370)
    at patchChildren (runtime-core.esm-bundler.js:4261)

renderIcon 属性只需绑定一个 AtIcon VNode 节点,正确的写法如下:

<at-card :renderIcon="renderIcon">...</at-card>
// data
const renderIcon = h(AtIcon, {...})

AtCurtain 报 Invalid VNode type: undefined (undefined)

问题描述

default slot 语法问题导致以上错误。

版本信息

v1.0.0-alpha.12

涉及的平台

h5, 小程序

错误信息

// h5
runtime-core.esm-bundler.js?5c40:38 [Vue warn]: Invalid VNode type: undefined (undefined) 
  at <TaroView class="at-curtain__body" > 
  at <TaroView class="at-curtain__container" > 
  at <TaroView class="at-curtain at-curtain--closed" onTap=fn<onTap> > 
  at <AtCurtain isOpened=false closeBtnPosition="bottom" onClose=fn<bound onClose> > 
  at <TaroView class="page" style= {width: "100%", margin: "auto"}margin: "auto"width: "100%"__proto__: Object > 
  at <Page headerTitle="Curtain 幕帘" > 
  at <CurtainDemo tid="/pages/view/curtain/index" > 
  at <App>

// weapp
VM32:1 [Vue warn]: Invalid VNode type:  (undefined) 
  at <AtCurtain isOpened=true closeBtnPosition="top" onClose=fn<bound onClose> > 
  at <Page headerTitle="Curtain 幕帘" > 
  at <CurtainDemo tid="pages/view/curtain/index?__key_=16037124863712" > 
  at <App>

代码

{ default: () => [
  { default: () => slots.default && slots.default() }, // <- 问题写法

  h(View, {...})
]}

v1.0.0-dev.1 - Can't resolve '@/style/components/skeleton.scss'

问题描述

v1.0.0-dev.1 仅用于测试 skeleton 组件。
目前样式引入存在问题。

版本信息

v1.0.0-dev.1

涉及的平台

小程序, h5

错误信息

./node_modules/taro-ui-vue3/dist/index.esm.js   or index.umd/js
Module not found: Can't resolve '@/style/components/skeleton.scss' in 'E:\miniprogram\test\node_modules\taro-ui-vue3\dist'

临时解决方案

请使用 v1.0.0-alpha.13

[H5] 使用 Taro.xxx 接口的组件报错:Taro__default.default.xxx is not a function

问题描述

详情见 #37

该问题是因 @tarojs/taro-h5 下提供的 Api 接口 未能通过 babel-plugin-transform-taroapi 正确转译所致。

https://github.com/NervJS/taro/tree/4c8a5ea9758f9c1c7e1efd1c9f4271a55c8feb97/packages/taro-h5
需要配合 babel-plugin-transform-taroapi 才能使用 ES6 default import 的语法,相关配置详情在 babel-preset-taro 中。

taro-ui-vue3 打包后提供三个格式的入口文件:

  • UMD ('browser' in package.json ): taro-ui-vue3/dist/index.umd.js
  • ES ('module' in package.json ): taro-ui-vue3/dist/index.esm.js
  • CJS ('main' in package.json ): taro-ui-vue3/dist/index.js

目前在 h5 环境中使用 CJS 和 UMD 格式的入口文件都存在上面的问题。

因为 @tarojs/webpack-runner 编译的入口顺序是 mainFields: ['main:h5', 'browser', 'module', 'main'], 所以优先引用了 UMD 入口。

版本信息

v1.0.0-alpha.8

涉及的平台

h5

错误信息

index.umd.js?aa1b:42 Uncaught (in promise) TypeError: Taro__default.default.createSelectorQuery is not a function
at delayQuerySelector (index.umd.js?aa1b:42)

临时解决方案

taro-ui-vue3 或者 Taro 解决该问题前,请先使用以下临时解决方案:

  1. 在 webpack 配置中添加一条 alias 配置,将 taro-ui-vue3 入口指向 index.esm.js
  alias: {
    "taro-ui-vue3$": "taro-ui-vue3/dist/index.esm.js"  // 注意加 $, 否则会导致样式引用报错
  }

或者
2. 在 node_modules/taro-ui-vue3/package.json 中添加 "main:h5": index.esm.js

Action-Sheet 展示页面出现关于 default slot 的警告

开发工具所报的警告信息如下:

[Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance.

原因是组件插槽所插入的是插槽内容,而非函数值。Vue3 推荐使用函数式插槽,以便获得更佳的性能。

h(AtActionSheetHeader, null, props.title) // 不推荐的写法

正确的写法如下:

h(AtActionSheetHeader, null, { default: () => props.title })

AtVirtualScroll 可视区域行数计算错误

问题描述

AtVirtualScroll 可视区域行数计算错误

版本信息

v1.0.0-alpha.13

涉及的平台

小程序 h5

代码

function getLast(first: number): number {
  // parseInt 笔误,导致 height 值固定不变
  const height = parseInt(`${props.height || 0, 10}`) || elRef.value.$el.clientHeight

  return first + Math.ceil(height / __itemHeight.value)
}

AtVirutalScroll 滚动时不停抖动

问题描述

AtVirutalScroll 向下滚动时,第一次到达 viewport + bench 的位置后,开始不停抖动。

原因是 rollup 打包时未处理与组件同一文件夹下的样式文件,导致打包后组件的样式丢失。

版本信息

v1.0.0-alpha.10

涉及的平台

小程序, h5

Toast 报 RangeError: Maximum call stack size exceeded

使用 watchEffect 时,flush 时机设置不对导致 RangeError.

VM457:1 RangeError: Maximum call stack size exceeded
    at Object.set (<anonymous>)
    at Object.set (reactivity.esm-bundler.js:251)
    at clearTimer (toast.ts:43)
    at handleChange (toast.ts:88)
    at toast.ts:34
    at callWithErrorHandling (runtime-core.esm-bundler.js:154)
    at getter (runtime-core.esm-bundler.js:4871)
    at reactiveEffect (reactivity.esm-bundler.js:42)
    at Array.job (runtime-core.esm-bundler.js:4913)
    at flushPostFlushCbs (runtime-core.esm-bundler.js:282)

H5 中 AtIndexes 点击字母索引跳转失效

问题描述

AtIndexes 编译为 H5 后,通过点击字母索引,无法跳转至目标位置。
#8 类似,应该是 h5 平台未能有效更新 _scrollTop 状态导致。

版本信息

v1.0.0-alpha.8

涉及的平台

h5

H5 Accordion 展开和收起动画异常

现象与 #13 一样。

原因是 H5 的点击事件为 MouseEvente.target.idnull, 导致 contentID 不是唯一。 可以将 e.timestamp 赋值给 contentID, 确保 contentID 是唯一的。

function handleClick(e: CommonEvent) {
    // contentID.value = 'content' + e.target.id
    contentID.value = 'content' + String(e.timeStamp).replace('.', '')
    ...
}

AtVirtualScroll 增加用于自定义虚拟列表顶部和底部内容的插槽

AtVirtualScroll 增加两个插槽,用于自定义 ScrollView 顶部和底部区域的内容。

// psuedo code
return h(View, {
   class: 'at-virtual-scroll__wrapper'
}, [
    // header 插槽,用于自定义顶部区域
    slots.header && slots.header(),

    // 虚拟列表
    h(ScrollView, mergeProps(
        { 
           ... // platform specific props
        }, 
        {
           class: 'at-virtual-scroll',
           ...  // common props
        }
    ), slots.default && slots.default()), // default 插槽, 用于自定义虚拟列表的内容
   
   // footer 插槽,用于自定义底部区域
   slots.footer && slots.footer()
])

AtDivider 自定义 height、fontSize 样式失效

问题描述

AtDivider 使用 heightfontSize 参数时,样式无效。
utilpxTransform 方法未处理 h5 的情况,导致其他使用了 pxTransform 的组件均存在这种情况。

版本信息

v1.0.0-alpha.11

涉及的平台

h5

AtButton 不能触发表格的 onSubmit/onReset 事件

报错信息

Cannot read property '$scope' of undefined
TypeError: Cannot read property '$scope' of undefined

实例无 $scope 属性

this.$scope.triggerEvent('submit', event.detail, {
     bubbles: true,
     composed: true
});

AtButton 无法绑定微信的 getUserInfo

问题描述

AtButton 无法绑定微信的 getUserInfo

版本信息

v1.0.0-alpha.12

涉及的平台

weapp

错误信息

代码

<at-button
  type="primary"
  class="login-btn"
  open-type="getUserInfo"
  @getuserinfo="onGotUserInfo"
>
  微信登录
</at-button>

AtSwipeAction could not find width of null

问题描述

AtSwipeAction 偶尔会报 could not find width of null,尤其是嵌套 AtVirtualScroll 使用,且初始指定跳转至具体列表行时,未渲染的的部分都会报错。

版本信息

v1.0.0-alpha.12

涉及的平台

小程序 h5

Accordion 展开和收起动画异常

  • 默认开始状态下,点击关闭时,动画过快,与默认关闭,打开后再关闭时的表现不一致。
  • 当使用多个 AtAccordion,并且内容项目数量不一致时,展开和收起动画会出现卡顿, 或动画过快,或展开位置超过内容高度后,才收起。

ImagePicker 事件冒泡问题

点击与添加图片按钮(+)相邻的预览图片的删除按钮(x)时,会触发chooseFile,自动弹出选择图片的界面。

样式引用问题

目前部分组件按需引用时,还需要引用所依赖的其他组件的样式,这样相对繁琐,对用户使用非常不友好。 如:

import { AtActivityIndicator } from 'taro-ui-vue3'

// 组件依赖的样式文件(仅按需引用时需要
@import "taro-ui-vue3/dist/style/components/activity-indicator.scss";
@import 'taro-ui-vue3/dist/style/components/loading.scss';

组件依赖的样式文件,最好在组件的样式文件中引用,不应该由用户另行引用。

AtFlex align-items 以及 align-content 样式无效

<at-flex align="start|end|stretch..."> 编译后小程序开发工具显示的样式貌似正确,
但是显示的样式始终为center

.at-row__align--stretch { //./pages/layout/flex/index.wxss: 675
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
-webkit-box-align: stretch;

}

style

Alipay 小程序 AtCalendar 滑动时不能更新月份

Alipay 小程序 AtCalendar 滑动时不能更新月份。

Taro 的 Swiper 组件只支持 onAnimationFinish 事件属性, 不支持 Alipay 小程序的 onAnimationEnd 事件属性, 因此通过 onAnimationFinish 无法更新月份。

// calendar/body/index.ts
h(Swiper, {
    class: 'main__body',
    ...
    onAnimationFinish: handleAnimateFinish, // <- onAnimationEnd
}, state.listGroup.map((item, key) => (
    h(SwiperItem, {
        ...
    }, [
       ...
    ])
)))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.