opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.65k stars 264 forks source link

✨ [Feature]: Setup and components #284

Closed Zhang-qiuxian closed 11 months ago

Zhang-qiuxian commented 1 year ago

What problem does this feature solve

官方能更新下setup的语法吗?还有组件能不能方便点不要每个组件每次引入都需要手动改一遍标签名 import { Dropdown, DropdownMenu, DropdownItem } from '@opentiny/vue'

export default { components: { TinyDropdown: Dropdown, TinyDropdownMenu: DropdownMenu, TinyDropdownItem: DropdownItem } } 有些组件就不能打包一起下载吗?像@opentiny/vue-icon,@opentiny/vue-modal等这些可以在安装的时候就提示或者全部都打包了一起下载 很容易误导人总是提示导包失败、例如以下,在setup语法下还需要手动去修改每个组件的名字,很麻烦。

What does the proposed API look like

可以参考element plus官网和vue官网都还不错

kagol commented 1 year ago

@Zhang-qiuxian 没问题的,文档支持 setup 语法我们正在规划。

kagol commented 1 year ago

@Zhang-qiuxian 这个是什么意思呢?

有些组件就不能打包一起下载吗?

目前TinyVue提供了多种使用方式,如果不想每个组件都单独引入,你可以通过全量引入方式:

import TinyVue from '@opentiny/vue'

const app = createApp(App)
app.use(TinyVue)

参考文档:https://opentiny.design/tiny-vue/zh-CN/os-theme/docs/import-components

Zhang-qiuxian commented 1 year ago

不好意思没说明白,是每个标签名都需要改,这个能优化一下,改用setup语法后每次copy出来的标签都需要手动的再修改一次表签名很繁琐

import { _Grid, GridColumn_ } from '@opentiny/vue'

export default {
  components: {
    _TinyGrid: Grid,
    TinyGridColumn: GridColumn_
  },