1.1.70 • Published 4 months ago

tj-design-vue v1.1.70

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

安装

使用 npm 安装

推荐使用 npm 方式进行开发

npm i tj-design-vue

通过 浏览器引入 安装

目前可以通过 unpkg.com/tj-design-vue 获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。

<!-- vue 3 -->
<script src="https://unpkg.com/vue@next"></script>
<link rel="stylesheet" href="https://unpkg.com/tj-design-vue/lib/index.css" />
<script src="https://unpkg.com/tj-design-vue"></script>
...
<script>
	Vue.createApp({}).use(TjDesign).mount('#app');
</script>

使用

TjDesign 提供了三种方式使用组件,具体使用方式如下

基础使用

基础使用会全量注册所有组件,如果您的项目大规模使用组件,请放心使用这种方式。

import { createApp } from 'vue';
import TjDesign from 'tj-design-vue';
import App from './app.vue';

// 引入组件库的少量全局样式变量
import 'tj-design-vue/lib/index.css';

const app = createApp(App);
app.use(TjDesign);

按需引入使用

如果您对产物大小有严格的要求,可以通过 按需引入具体组件 的方式来使用。

借助 Webpack 或 Rollup 等支持 tree-shaking 特性的构建工具,可以达到按需引入的使用效果。

import { createApp } from 'vue';
import {  TjButton } from 'tj-design-vue';
import App from './app.vue';

// 引入组件库的少量全局样式变量
import 'tj-design-vue/es/button/index.css';

const app = createApp(App);
app.use(TjButton);

编辑器提示

安装注册 TjDesign 之后,在开发项目时,可以配合插件在VSCode等主流编辑器中达到提示组件名及API的效果。

如果你在使用 Volar,那么可以在 tsconfig.json 中配置 compilerOptions.types 来指定全局组件类型。

// tsconfig.json
{
  "compilerOptions": {
    // ...
    "types": ["tj-design-vue/types/volar"]
  }
}

浏览器兼容性

IE / EdgeFirefoxChromeSafari
Edge >=84Firefox >=83Chrome >=84Safari >=14.1

FAQ

Q: 是否内置reset样式统一页面元素的默认样式 ?

A: 0.17.0 版本开始我们不再引入 reset.less,影响最大的是移除了原先全局盒子模型的设定:

*,
*::before,
*::after {
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
1.1.70

4 months ago

1.1.67

4 months ago

1.1.66

4 months ago

1.1.69

4 months ago

1.1.68

4 months ago

1.1.63

4 months ago

1.1.65

4 months ago

1.1.64

4 months ago

1.1.62

4 months ago

1.1.61

5 months ago

1.1.60

5 months ago

1.1.59

5 months ago

1.1.58

5 months ago

1.1.57

5 months ago

1.1.56

5 months ago

1.1.55

5 months ago

1.1.54

6 months ago

1.1.38

6 months ago

1.1.39

6 months ago

1.1.41

6 months ago

1.1.40

6 months ago

1.1.45

6 months ago

1.1.44

6 months ago

1.1.43

6 months ago

1.1.42

6 months ago

1.1.49

6 months ago

1.1.48

6 months ago

1.1.47

6 months ago

1.1.46

6 months ago

1.1.52

6 months ago

1.1.50

6 months ago

1.1.53

6 months ago

1.1.29

7 months ago

1.1.28

8 months ago

1.1.30

7 months ago

1.1.34

7 months ago

1.1.33

7 months ago

1.1.32

7 months ago

1.1.31

7 months ago

1.1.37

6 months ago

1.1.36

7 months ago

1.1.35

7 months ago

1.1.27

8 months ago

1.1.26

8 months ago

1.1.25

8 months ago

1.1.24

8 months ago

1.1.23

8 months ago

1.1.22

8 months ago

1.1.21

8 months ago

1.1.2

8 months ago

1.1.19

8 months ago

1.1.18

8 months ago

1.1.17

8 months ago

1.1.16

8 months ago

1.1.14

8 months ago

1.1.13

8 months ago

1.1.12

8 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.1

11 months ago

1.1.0

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago