更新依赖

pull/1050/head
lyswhut 2022-11-03 07:35:48 +08:00
parent 716120ea61
commit 3f8c47100d
6 changed files with 401 additions and 863 deletions

View File

@ -4,6 +4,7 @@ module.exports = {
'electron',
'chalk',
'del',
'svgo-loader',
],
// target: 'newest',
// filter: [

1217
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "lx-music-desktop",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "一个免费的音乐查找助手",
"main": "./dist/main.js",
"productName": "lx-music-desktop",
@ -214,10 +214,10 @@
"@types/better-sqlite3": "^7.6.2",
"@types/needle": "^2.5.3",
"@types/tunnel": "^0.0.3",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"@volar/vue-language-plugin-pug": "^1.0.9",
"babel-loader": "^8.2.5",
"babel-loader": "^9.0.1",
"browserslist": "^4.21.4",
"chalk": "^4.1.2",
"changelog-parser": "^2.8.1",
@ -227,21 +227,21 @@
"css-loader": "^6.7.1",
"css-minimizer-webpack-plugin": "^4.2.2",
"del": "^6.1.1",
"electron": "^19.1.3",
"electron-builder": "^24.0.0-alpha.2",
"electron": "^19.1.4",
"electron-builder": "^24.0.0-alpha.3",
"electron-debug": "^3.2.0",
"electron-devtools-installer": "^3.2.0",
"electron-to-chromium": "^1.4.284",
"electron-updater": "^6.0.0-alpha.1",
"electron-updater": "^6.0.0-alpha.2",
"eslint": "^8.26.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-formatter-friendly": "github:lyswhut/eslint-friendly-formatter#2170d1320e2fad13615a9dcf229669f0bb473a53",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-n": "^15.4.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.6.0",
"eslint-plugin-vue": "^9.7.0",
"eslint-webpack-plugin": "^3.2.0",
"html-webpack-plugin": "^5.5.0",
"less": "^4.1.3",
@ -263,7 +263,7 @@
"ts-loader": "^9.4.1",
"typescript": "^4.8.4",
"vue-eslint-parser": "^9.1.0",
"vue-loader": "^17.0.0",
"vue-loader": "^17.0.1",
"vue-template-compiler": "^2.7.13",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",

View File

@ -1,19 +1,31 @@
<template>
<teleport to="#root">
<component :is="Teleport" to="#root">
<div :class="[$style.popup, {[$style.top]: isShowTop}, {[$style.active]: props.visible}]" :style="popupStyle" :aria-hidden="!props.visible" @click.stop>
<div ref="dom_content" class="scroll" :class="$style.list">
<slot />
</div>
</div>
</teleport>
</component>
</template>
<script setup lang="ts">
import { ref, watch, onMounted, onBeforeUnmount, reactive, defineEmits } from '@common/utils/vueTools'
// https://github.com/vuejs/core/issues/2855#issuecomment-768388962
import {
Teleport as teleport_,
TeleportProps,
VNodeProps,
} from 'vue'
const Teleport = teleport_ as {
new (): {
$props: VNodeProps & TeleportProps
}
}
const props = defineProps<{
visible: boolean
el: HTMLElement | null
btnEl: HTMLElement | null
}>()
interface Emitter {
@ -35,8 +47,8 @@ const arrowHeight = 9
const arrowWidth = 8
watch(() => props.visible, (visible) => {
if (!visible || !dom_content.value || !props.el) return
const rect = props.el.getBoundingClientRect()
if (!visible || !dom_content.value || !props.btnEl) return
const rect = props.btnEl.getBoundingClientRect()
const maxHeight = document.body.clientHeight
const elTop = rect.top - window.lx.rootOffset
const bottomTopVal = elTop + rect.height

View File

@ -246,7 +246,7 @@ export default {
.title {
max-width: 100%;
font-size: 13px;
font-size: 12px;
color: var(--color-font-label);
.mixin-ellipsis-1;
}

View File

@ -1,7 +1,7 @@
<template>
<div ref="dom_btn" :class="$style.content" @click="handleShowPopup">
<slot />
<base-popup v-model:visible="visible" :el="dom_btn">
<base-popup v-model:visible="visible" :btn-el="dom_btn">
<slot name="content" />
</base-popup>
</div>