Skip to content

Commit

Permalink
Merge pull request #41 from bhabgs/master
Browse files Browse the repository at this point in the history
组件更新
  • Loading branch information
bhabgs authored Apr 25, 2021
2 parents 7c0759d + 21bf9e3 commit ecfa4af
Show file tree
Hide file tree
Showing 19 changed files with 431 additions and 158 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"private": true,
"devDependencies": {
"patch-vue-directive-ssr": "^0.0.1",
"@vitejs/plugin-vue": "^1.1.4",
"@vitejs/plugin-vue-jsx": "^1.1.0",
"@vitejs/plugin-vue": "^1.2.1",
"@vitejs/plugin-vue-jsx": "^1.1.3",
"@vue/compiler-sfc": "^3.0.5",
"less": "^4.1.1",
"typescript": "^4.1.3",
Expand Down
4 changes: 2 additions & 2 deletions package/vitevui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitevui",
"version": "1.0.0-beta.18",
"version": "1.0.0-beta.19",
"description": "vue3.0 ui",
"main": "lib/index.js",
"homepage": "https://bhabgs.github.io/vite-vui-docs/",
Expand Down Expand Up @@ -40,7 +40,7 @@
"cz-conventional-changelog": "^3.3.0",
"commitizen": "^4.2.3",
"@vitejs/plugin-vue": "^1.1.4",
"@vitejs/plugin-vue-jsx": "^1.1.0",
"@vitejs/plugin-vue-jsx": "^1.1.3",
"@vue/compiler-sfc": "^3.0.5",
"less": "^4.1.1",
"typescript": "^4.1.3",
Expand Down
16 changes: 14 additions & 2 deletions package/vitevui/src/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: bhabgs
* @Date: 2021-02-21 15:44:28
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-20 15:28:51
* @LastEditTime: 2021-04-23 11:20:43
*/
import { defineComponent } from 'vue';
import { setStyleClass, installComponent, getSlots } from '../util/index';
Expand All @@ -14,10 +14,16 @@ const buttonProps = {
type: String,
default: 'default',
},
accept: String,
radius: {
type: Boolean,
default: true,
},
multiple: Boolean,
disabled: {
type: Boolean,
default: false,
},
};

const Button = defineComponent({
Expand All @@ -41,7 +47,13 @@ const Button = defineComponent({
<slots.uploadTitle />
)}
</div>
<input class={classes} type='file' />
<input
class={classes}
type='file'
accept={props.accept}
multiple={props.multiple}
disabled={props.disabled}
/>
</>
) : (
<slots.def />
Expand Down
47 changes: 13 additions & 34 deletions package/vitevui/src/icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* @abstract: JianJie
* @version: 0.0.1
* @Author: bhabgs
* @Date: 2021-04-16 15:53:51
* @Date: 2021-04-21 14:06:07
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-20 15:30:25
* @LastEditTime: 2021-04-21 14:32:05
*/
import { defineComponent } from 'vue';
import { installComponent } from '../util';

const iconProps = {
const props = {
name: {
type: String,
default: '',
Expand All @@ -22,38 +22,17 @@ const iconProps = {
};

const viIcon = defineComponent({
name: 'viIcon',
props: iconProps,
emits: ['click'],
setup(props, context) {
// withModifiers(() => {
//}, ['stop'])
const emitClick = () => {
context.emit('click');
props,
setup(props) {
return () => {
return props.svg ? (
<svg class={['vite_ icon', props.class]} aria-hidden='true'>
<use xlinkHref={`#${props.name}`}></use>
</svg>
) : (
<i class={[`vite_ ${props.name}`, props.class]}></i>
);
};
return () => (
<>
{props.svg ? (
<svg
class={['vite_ icon', props.class]}
aria-hidden='true'
onClick={() => {
emitClick();
}}
>
<use xlinkHref={`#${props.name}`}></use>
</svg>
) : (
<i
onClick={() => {
emitClick();
}}
class={[`vite_ ${props.name}`, props.class]}
></i>
)}
</>
);
},
});

export default installComponent(viIcon, 'viIcon');
2 changes: 1 addition & 1 deletion package/vitevui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: bhabgs
* @Date: 2021-01-05 14:05:58
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-20 15:52:43
* @LastEditTime: 2021-04-21 14:33:01
*/
import type { App } from 'vue';
import { setupElement } from './setup/element';
Expand Down
28 changes: 26 additions & 2 deletions package/vitevui/src/style/upload/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
.vite_upload_box {
display: flex;
flex-direction: column;
&.vite_upload_disabled {
.vite_button_upload {
opacity: 0.5;
input {
opacity: 0;
}
}
}
.vite_button_upload {
width: 7.86rem;
height: 7.86rem;
Expand All @@ -17,6 +25,15 @@
margin-bottom: 0.3rem;
box-sizing: border-box;
border: 1px solid @gray-4;
position: relative;
.progress {
position: absolute;
height: 2px;
left: 0;
bottom: 0;
z-index: 2;
.animate3();
}
}
&.img_video_box {
margin-top: 0.3rem;
Expand Down Expand Up @@ -76,13 +93,20 @@
}
}
}

.item_close {
a {
text-decoration: none;
color: @black;
}
.item_close,
.loadfile_button {
cursor: pointer;
.animate3();
&:hover {
color: @red;
}
}
.loadfile_button {
font-size: 1.3rem;
}
}
}
8 changes: 4 additions & 4 deletions package/vitevui/src/tabsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @Author: bhabgs
* @Date: 2021-04-06 11:13:21
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-20 15:49:57
* @LastEditTime: 2021-04-21 14:40:26
*/
import { defineComponent, App, computed, nextTick } from 'vue';
import { defineComponent, computed, nextTick } from 'vue';
import componentsBox from './components';
import { arrayCheck, setStyleClass, viteTypeof } from '../util';
import log from '../util/log';
Expand Down Expand Up @@ -112,11 +112,11 @@ const viteTabs = defineComponent({
flag = newArr.length;
}

if (flag === 100000) {
if (flag - 1 < 0) {
return log.warn('默认第一个page 为主page,主page无法删除');
}

if (!arrayCheck(newArr, tabsData.list, 'id')) {
if (!arrayCheck(newArr, tabsData.list, 'id') && flag - 1 >= 0) {
updatePage(newArr, tabsData.list[flag - 1].id);
} else {
log.warn('没有匹配的键');
Expand Down
19 changes: 5 additions & 14 deletions package/vitevui/src/tabsPage/tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: bhabgs
* @Date: 2021-04-06 11:43:20
* @LastEditors: bhabgs
* @LastEditTime: 2021-04-20 15:50:19
* @LastEditTime: 2021-04-21 14:36:34
*/
import { defineComponent, withModifiers } from 'vue';
import { setStyleClass } from '../util';
Expand Down Expand Up @@ -44,22 +44,13 @@ export default defineComponent({
{item.name}
</span>
{item.hasClosed ? (
<viIcon
<vi-icon
name={'vite_close'}
onClick={(e: any) => {
remove([item.id]);
}}
onClick={withModifiers(() => {
remove(item.id);
}, ['stop'])}
/>
) : (
// <i
// class='vite_close vite_'
// onClick={withModifiers(
// (e: any) => {
// remove([item.id]);
// },
// ['stop'],
// )}
// ></i>
''
)}
</div>
Expand Down
Loading

0 comments on commit ecfa4af

Please sign in to comment.