0.0.100 • Published 6 months ago

yuhong-ui v0.0.100

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

yh-ui

This template should help get you started developing with Vue 3 in Vite.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

安装组件

yu-ui 是基于 element-plus 开发的, 采用 pinia,sass 等架构 所以必须引入 element-plus,pinia,sass

npm i yh-ui

Project Setup

npm install

预览打包之后的项目

npm run preview

Compile and Hot-Reload for Development

npm run start

Type-Check, Compile and Minify for Production

npm run build 打包全部内容
src/pages 文档路径

Run Unit Tests with Vitest

npm run test:unit

Lint with ESLint

npm run lint

预览文档

npm run docs:start

采用 tsx 语法

每个组件需要增加 const React = { createElement: h, Fragment };

建议使用局部注册官方说明

全局注册虽然很方便,但有以下几个问题:

全局注册,但并没有被使用的组件无法在生产打包时被自动移除 (也叫“tree-shaking”)。如果你全局注册了一个组件,即使它并没有被实际使用,它仍然会出现在打包后的 JS 文件中。

全局注册在大型项目中使项目的依赖关系变得不那么明确。在父组件中使用子组件时,不太容易定位子组件的实现。和使用过多的全局变量一样,这可能会影响应用长期的可维护性。

相比之下,局部注册的组件需要在使用它的父组件中显式导入,并且只能在该父组件中使用。它的优点是使组件之间的依赖关系更加明确,并且对 tree-shaking 更加友好。

0.0.100

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago

0.0.0-beta13

6 months ago

0.0.0-beta12

6 months ago

0.0.0-beta11

6 months ago

0.0.0-beta10

6 months ago

0.0.0-beta9

6 months ago

0.0.0-beta8

6 months ago

0.0.0-beta7

6 months ago

0.0.0-beta6

6 months ago

0.0.0-beta5

6 months ago

0.0.0-beta4

7 months ago

0.0.0-beta3

7 months ago

0.0.0-beta2

7 months ago

0.0.0-beta1

7 months ago