chore: 升级全局依赖

This commit is contained in:
就眠儀式
2022-04-21 00:09:15 +08:00
parent 60533e021d
commit 95751c826d
14 changed files with 242 additions and 215 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@layui/layui-vue",
"version": "1.0.4-alpha.5",
"version": "1.0.4",
"author": "就眠儀式",
"license": "MIT",
"description": "a component library for Vue 3 base on layui-vue",
@@ -30,9 +30,9 @@
"build:types": "rimraf types && tsc -d"
},
"dependencies": {
"@layui/icons-vue": "^1.0.7",
"@layui/layer-vue": "^1.3.12",
"@vueuse/core": "^7.6.2",
"@layui/icons-vue": "^1.0.8",
"@layui/layer-vue": "^1.3.13",
"@vueuse/core": "^8.3.0",
"animate.css": "^4.1.1",
"async-validator": "^4.0.7",
"cropperjs": "^1.5.12",
@@ -49,13 +49,13 @@
"@rollup/plugin-babel": "^5.3.0",
"@types/node": "^16.11.9",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/compiler-sfc": "^3.2.31",
"@vue/server-renderer": "^3.2.31",
"@vue/compiler-sfc": "^3.2.33",
"@vue/server-renderer": "^3.2.33",
"less": "^4.1.2",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"typescript": "^4.6.3",
"vite": "2.9.1"
"vite": "2.9.2"
},
"files": [
"lib",

View File

@@ -89,7 +89,7 @@ const sub = function () {
if (childrens.value[i].props.id === active.value) {
if (i === 0) {
active.value = childrens.value[slots.length - 1].props.id;
}else{
} else {
active.value = childrens.value[i - 1].props.id;
}
break;
@@ -103,7 +103,7 @@ const add = function () {
if (childrens.value[i].props.id === active.value) {
if (i === childrens.value.length - 1) {
active.value = childrens.value[0].props.id;
}else{
} else {
active.value = childrens.value[i + 1].props.id;
}
break;
@@ -117,7 +117,7 @@ const autoplay = () => {
if (childrens.value[i].props.id === active.value) {
if (i === childrens.value.length - 1) {
active.value = childrens.value[0].props.id;
}else{
} else {
active.value = childrens.value[i + 1].props.id;
}
break;

View File

@@ -5,4 +5,4 @@ Component.install = (app: App) => {
app.component(Component.name, Component);
};
export default Component;
export default Component;

View File

@@ -4,27 +4,46 @@
:style="{ background, height: `${height}px` }"
v-show="!isMode"
>
<div class="layui-notice-bar-warp" :style="{ color, fontSize: `${size}px` }">
<div
class="layui-notice-bar-warp"
:style="{ color, fontSize: `${size}px` }"
>
<lay-icon
v-if="leftIcon"
class="layui-notice-bar-warp-left-icon"
:type="leftIcon"
></lay-icon>
<div class="layui-notice-bar-warp-text-box" ref="noticeBarWarpRef" :style="'--textWidth--:'+ text.length+'em'">
<div
class="layui-notice-bar-warp-text-box"
ref="noticeBarWarpRef"
:style="'--textWidth--:' + text.length + 'em'"
>
<div
class="layui-notice-bar-warp-text"
ref="noticeBarTextRef"
v-if="!scrollable"
>{{ text }}
>
{{ text }}
</div>
<div class="layui-notice-bar-warp-slot" v-else>
<lay-carousel
v-model="active"
indicator="none"
anim="updown"
arrow="none"
:style="{ height: `40px` }"
>
<lay-carousel-item
v-for="item in textlist"
:key="item.id"
:id="item.id"
class="layui-anim layui-anim-up"
>
{{ item.text }}
</lay-carousel-item>
</lay-carousel>
<!-- <slot /> -->
</div>
<div class="layui-notice-bar-warp-slot " v-else>
<lay-carousel v-model="active" indicator="none" anim="updown" arrow="none" :style="{height:`40px`}">
<lay-carousel-item v-for="(item) in textlist" :key="item.id" :id="item.id" class="layui-anim layui-anim-up">
{{item.text}}
</lay-carousel-item>
</lay-carousel>
<!-- <slot /> -->
</div>
</div>
<lay-icon
:type="rightIcon"
@@ -45,10 +64,10 @@ import {
onMounted,
nextTick,
} from "vue";
import LayCarousel from '../carousel/index.vue'
import LayCarousel from "../carousel/index.vue";
export default defineComponent({
name: "LayNoticeBar",
components: {
components: {
LayCarousel,
},
props: {
@@ -113,8 +132,8 @@ export default defineComponent({
setup(props, { emit }) {
const noticeBarWarpRef = ref();
const noticeBarTextRef = ref();
//@ts-ignore
const active = ref(props.textlist[0]?.id)
//@ts-ignore
const active = ref(props.textlist[0]?.id);
const state = reactive({
order: 1,
oneTime: 0,
@@ -122,7 +141,7 @@ export default defineComponent({
warpOWidth: 0,
textOWidth: 0,
isMode: false,
height : 40,
height: 40,
});
// 初始化 animation 各项参数
const initAnimation = () => {
@@ -182,7 +201,7 @@ export default defineComponent({
noticeBarTextRef,
onRightIconClick,
...toRefs(state),
active
active,
};
},
});
@@ -208,36 +227,48 @@ export default defineComponent({
overflow: hidden;
position: relative;
}
.layui-notice-bar .layui-notice-bar-warp .layui-notice-bar-warp-text-box .layui-notice-bar-warp-text {
.layui-notice-bar
.layui-notice-bar-warp
.layui-notice-bar-warp-text-box
.layui-notice-bar-warp-text {
white-space: nowrap;
position: absolute;
left: 0;
}
@keyframes around1 {
from {
left: 0;
}
to {
left: calc(0px - var(--textWidth--));
/* left: -100%; */
}
from {
left: 0;
}
to {
left: calc(0px - var(--textWidth--));
/* left: -100%; */
}
}
@keyframes around2 {
from {
left: calc(var(--textWidth--));
/* left: 100%; */
}
to {
from {
left: calc(var(--textWidth--));
/* left: 100%; */
}
to {
/* left: calc(0px - var(--textWidth--) - 10px); */
left: 0;
}
left: 0;
}
}
.layui-notice-bar .layui-notice-bar-warp .layui-notice-bar-warp-text-box .layui-notice-bar-warp-slot {
.layui-notice-bar
.layui-notice-bar-warp
.layui-notice-bar-warp-text-box
.layui-notice-bar-warp-slot {
width: 100%;
white-space: nowrap;
}
.layui-notice-bar .layui-notice-bar-warp .layui-notice-bar-warp-text-box .layui-notice-bar-warp-slot .layui-carousel >[carousel-item] * {
.layui-notice-bar
.layui-notice-bar-warp
.layui-notice-bar-warp-text-box
.layui-notice-bar-warp-slot
.layui-carousel
> [carousel-item]
* {
display: flex;
align-items: center;
}
@@ -251,7 +282,9 @@ export default defineComponent({
text-align: right;
font-size: inherit !important;
}
.layui-notice-bar .layui-notice-bar-warp .layui-notice-bar-warp-right-icon:hover {
.layui-notice-bar
.layui-notice-bar-warp
.layui-notice-bar-warp-right-icon:hover {
cursor: pointer;
}
</style>
</style>

View File

@@ -8,10 +8,11 @@ export default {
import { StringOrNumber } from "./tree.type";
import LayIcon from "../icon";
import LayCheckbox from "../checkbox";
import { Ref } from "vue";
import { Ref, useSlots } from "vue";
import { Tree } from "./tree";
import { Nullable } from "../../types";
import LayTransition from "../transition/index.vue";
type CustomKey = string | number;
type CustomString = (() => string) | string;
@@ -41,6 +42,7 @@ interface TreeNodeEmits {
(e: "node-click", node: TreeData): void;
}
const slots = useSlots();
const props = defineProps<TreeNodeProps>();
const emit = defineEmits<TreeNodeEmits>();

View File

@@ -163,7 +163,7 @@ const components: Record<string, Component> = {
LayTransition,
LayUpload,
LayRipple,
LayNoticeBar
LayNoticeBar,
};
const install = (app: App, options?: InstallOptions): void => {