Skip to content

Commit

Permalink
feat: add pug plugin and jsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kuoruan committed Jan 22, 2024
1 parent 399e634 commit bf6b4bd
Show file tree
Hide file tree
Showing 14 changed files with 248 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"vue.vscode-typescript-vue-plugin"
]
}
16 changes: 16 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
],
}
},
"vueCompilerOptions": {
"target": 2.7,
"plugins": [
"@vue/language-plugin-pug"
]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"devDependencies": {
"@vitejs/plugin-vue2": "^2.3.1",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/language-plugin-pug": "^1.8.27",
"chalk": "^5.3.0",
"eslint": "^8.56.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
99 changes: 99 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/components/CheckboxHeader.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template lang="pug">
th(width="40" class="{sorter: false}")
input.select-all(
type="checkbox",
v-model="checked",
@change="$emit('change', $event.target.checked)"
)
th(width="40" class="{sorter: false}")
input.select-all(
type="checkbox",
v-model="checked",
@change="$emit('change', $event.target.checked)"
)
</template>

<script>
Expand Down
14 changes: 7 additions & 7 deletions src/components/CheckboxItem.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template lang="pug">
td(width="40")
input.select(
type="checkbox",
v-model="checked",
:data-index="index",
@change="$emit('change', $event.target.checked)"
)
td(width="40")
input.select(
type="checkbox",
v-model="checked",
:data-index="index",
@change="$emit('change', $event.target.checked)"
)
</template>

<script>
Expand Down
46 changes: 23 additions & 23 deletions src/components/LinksPopup.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<template lang="pug">
popup-wrapper(
:z-index="zIndex",
@overlay-click="$emit('close')",
:middle="false",
:margin-top="100",
)
div.popup-header
h4 查看链接
button.btn(@click="$emit('close')") 关闭
div.popup-body
textarea.links-box(
v-model="content",
rows="10",
cols="80",
:style="textStyle",
ref="textarea"
)
div.popup-footer
button.btn(@click="resetContent") 重置
popup-wrapper(
:z-index="zIndex",
@overlay-click="$emit('close')",
:middle="false",
:margin-top="100",
)
div.popup-header
h4 查看链接
button.btn(@click="$emit('close')") 关闭
div.popup-body
textarea.links-box(
v-model="content",
rows="10",
cols="80",
:style="textStyle",
ref="textarea"
)
div.popup-footer
button.btn(@click="resetContent") 重置

button.btn(@click="selectAll") 全选
button.btn(@click="copySelected") 复制选中
button.btn(@click="copyAll") 复制全部
button.btn(@click="selectAll") 全选
button.btn(@click="copySelected") 复制选中
button.btn(@click="copyAll") 复制全部

p 共 {{ links.length }} 条链接
p 共 {{ links.length }} 条链接
</template>

<script>
Expand Down
20 changes: 10 additions & 10 deletions src/components/PopupWrapper.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template lang="pug">
div.overlay(
@click.self="$emit('overlay-click')",
@touchmove="onScroll",
@mousewheel="onScroll",
:style="{'z-index': zIndex}"
div.overlay(
@click.self="$emit('overlay-click')",
@touchmove="onScroll",
@mousewheel="onScroll",
:style="{'z-index': zIndex}"
)
div.popup(
:class="{'middle': middle}",
:style="{'margin-top': `${marginTop}px`}"
)
div.popup(
:class="{'middle': middle}",
:style="{'margin-top': `${marginTop}px`}"
)
slot
slot
</template>

<script>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ToastItem.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="pug">
div.toast(:class="{'show': show}")
span.text {{ text }}
div.toast(:class="{'show': show}")
span.text {{ text }}
</template>

<script>
Expand Down
56 changes: 28 additions & 28 deletions src/components/ToolBar.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<template lang="pug">
div.tool-bar(
:class="[position, {'visible': visible}]"
)
div.wrapper
span.title 下载助手
label(:for="`clean-${position}`") 清理链接:
input.checkbox(
:id="`clean-${position}`",
type="checkbox",
v-model="opts.clean"
)
label(:for="`separator-${position}`") 分隔符:
select(
v-model="opts.separator",
:id="`separator-${position}`"
)
option(value="\n") \n
option(value="\r\n") \r\n
option(value="\t") \t
option(value=" ") 空格
option(value=",") ,
.btn-wrapper
button.btn(
@click="$emit('copy', opts)"
) 复制
button.btn(
@click="$emit('show', opts)"
) 查看
div.tool-bar(
:class="[position, {'visible': visible}]"
)
div.wrapper
span.title 下载助手
label(:for="`clean-${position}`") 清理链接:
input.checkbox(
:id="`clean-${position}`",
type="checkbox",
v-model="opts.clean"
)
label(:for="`separator-${position}`") 分隔符:
select(
v-model="opts.separator",
:id="`separator-${position}`"
)
option(value="\n") \n
option(value="\r\n") \r\n
option(value="\t") \t
option(value=" ") 空格
option(value=",") ,
.btn-wrapper
button.btn(
@click="$emit('copy', opts)"
) 复制
button.btn(
@click="$emit('show', opts)"
) 查看
</template>

<script>
Expand Down
12 changes: 6 additions & 6 deletions src/components/TorrentDownloadHeader.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template lang="pug">
th(
width="5%",
nowrap="nowrap",
class="{sorter: false}"
)
span(class="title") Torrent
th(
width="5%",
nowrap="nowrap",
class="{sorter: false}"
)
span(class="title") Torrent
</template>

<script>
Expand Down
Loading

0 comments on commit bf6b4bd

Please sign in to comment.