b2nil / taro-ui-vue3

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

refactor: remove dependency of classnames and className and customStyle props #21

Closed b2nil closed 3 years ago

b2nil commented 3 years ago

This PR is mainly intended to:

  1. Use computed classes to replace the dependency of classnames
    const rootClasses = computed(() => ({
    'at-xxx': true,
    }))
  2. Use class and style to replace the props of className and customStyle
    <at-card class="custom-class" style="height: 20px;">...</at-card>

    The props of class and style will be merged to the attrs of the component's root node:

    setup(props, { slots, attrs }) {
    h(View, mergeProps(attrs, {
     class: rootClasses.value
    }), slots.default())
    }
  3. and some other minor fixes