Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.
/ tyh-ui2 Public archive

Commit 044d179

Browse files
committed
chore: 更新构建配置
1 parent 84c8f32 commit 044d179

File tree

14 files changed

+1186
-2772
lines changed

14 files changed

+1186
-2772
lines changed

CHANGELOG_zh.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
[English](https://github.com/Tyh2001/tyh-ui2/blob/master/CHANGELOG.md) | Chinese
44

5+
## 4.0.0 (2022-07-24)
6+
7+
## 3.6.0 (2022-07-24)
8+
9+
- 优化组件类型限制
10+
- 更新插件配置
11+
- 优化组件细节样式
12+
- 增加样式按需引入
13+
514
## 3.5.0 (2022-05-06)
615

716
- 取消组件代码封转

docs/docs/components/button.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
| size | 按钮尺寸 | string | large / small / mini | —— |
259259
| square | 方形按钮 | boolean | —— | false |
260260
| loading | loading 状态 | boolean | —— | false |
261+
| block | 是否为块级元素 | boolean | —— | false |
261262

262263
<style scoped>
263264
.tyh-button-group,

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
"node": ">= 16"
55
},
66
"scripts": {
7+
"clean": "rimraf dist",
78
"start": "pnpm run -C start dev",
89
"dev:docs": "pnpm run -C docs dev",
9-
"build": "pnpm build:css && vite build && pnpm build:theme && pnpm move",
10+
"build": "pnpm clean && pnpm build:css && vite build && pnpm build:lib && pnpm build:umd && pnpm build:theme",
1011
"build:docs": "pnpm run -C docs build",
12+
"build:es": "vite build --config vite.config.ts",
1113
"build:theme": "vite build --config vite.config.theme.ts",
14+
"build:umd": "vite build --config vite.config.umd.ts",
15+
"build:lib": "vite build --config vite.config.lib.ts",
1216
"build:css": "vite build --config vite.config.css.ts",
1317
"move": "node ./script/move-file.js",
14-
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json --max-warnings 0 && pretty-quick --check --branch master",
15-
"lint:fix": "eslint --fix . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json && pretty-quick --branch master",
1618
"prettier": "prettier --write .",
17-
"prepare": "husky install",
1819
"commit": "cz"
1920
},
2021
"license": "ISC",
@@ -26,15 +27,15 @@
2627
"unplugin-vue-setup-extend-plus": "^0.3.2",
2728
"vite-plugin-compression": "^0.5.1",
2829
"vite-plugin-dts": "^1.2.0",
29-
"vue": "^3.2.31"
30+
"vue": "^3.2.33"
3031
},
3132
"lint-staged": {
3233
"*.{vue,js,ts,md,json}": "prettier --write"
3334
},
3435
"devDependencies": {
3536
"@commitlint/cli": "^16.2.1",
3637
"@commitlint/config-conventional": "^16.2.1",
37-
"@vitejs/plugin-vue": "^2.2.0",
38+
"@vitejs/plugin-vue": "^2.3.1",
3839
"commitizen": "^4.2.4",
3940
"cz-conventional-changelog": "^3.3.0",
4041
"eslint": "^8.9.0",
@@ -46,8 +47,8 @@
4647
"prettier": "^2.5.1",
4748
"pretty-quick": "^3.1.3",
4849
"typescript": "^4.5.4",
49-
"vite": "^2.8.0",
50-
"vue-router": "^4.0.13",
50+
"rimraf": "^3.0.2",
51+
"vite": "^2.9.5",
5152
"vue-tsc": "^0.29.8"
5253
},
5354
"config": {
Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<button :class="[...isClass, ...typeClass]" :disabled="disabled || loading">
2+
<button :class="classList" :disabled="disabled || loading" :style="{ color }">
33
<i
44
v-if="loading || icon"
55
:class="['tyh-icon', loading ? 'tyh-ui-loading' : icon]"
66
:style="{ color }"
77
/>
8-
<span v-if="$slots.default" :style="{ color }"><slot /></span>
8+
<slot />
99
</button>
1010
</template>
1111

12-
<script lang="ts" setup>
12+
<script lang="ts" setup name="TyhButton">
1313
import { computed } from 'vue'
1414
import { Props } from './props'
1515
import { THEME } from '@tyh-ui2/utils'
@@ -21,26 +21,18 @@
2121
return prop.type === 'default' || !prop.type ? '#333' : '#fff'
2222
})
2323
24-
const isClass = computed((): (string | object)[] => {
24+
const classList = computed((): (string | object)[] => {
2525
return [
2626
'tyh-button',
27+
`tyh-button-${prop.type}`,
2728
{
28-
[`tyh-button-size-${prop.size}`]: prop.size,
29+
[`tyh-button-${prop.size}`]: prop.size,
2930
'tyh-button-round': prop.round,
30-
'tyh-button-square': prop.square
31+
'tyh-button-square': prop.square,
32+
'tyh-button-simple': prop.simple,
33+
'tyh-button-disabled': prop.disabled || prop.loading,
34+
'tyh-button-block': prop.block
3135
}
3236
]
3337
})
34-
35-
const typeClass = computed((): string[] => {
36-
return [
37-
prop.simple
38-
? prop.disabled || prop.loading
39-
? `tyh-button-simple-disabled-${prop.type}`
40-
: `tyh-button-simple-${prop.type}`
41-
: prop.disabled || prop.loading
42-
? `tyh-button-disabled-${prop.type}`
43-
: `tyh-button-${prop.type}`
44-
]
45-
})
4638
</script>

packages/components/button/src/props.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ export const Props = {
2727
},
2828
square: Boolean,
2929
simple: Boolean,
30-
loading: Boolean
30+
loading: Boolean,
31+
block: Boolean
3132
} as const

0 commit comments

Comments
 (0)