Update to vue 2.7

This commit is contained in:
timongh 2023-07-23 06:02:13 +08:00
parent 0b67f12069
commit 68c39475b4
5 changed files with 2996 additions and 4548 deletions

View File

@ -46,6 +46,7 @@ module.exports = {
},
],
'vue/multi-word-component-names': 'off',
'vue/max-attributes-per-line': 'off',
'vue/html-self-closing': 'off',
'vue/no-v-html': 'off',

View File

@ -21,6 +21,8 @@ pnpm install
- [配置 VS Code 插件](https://code.visualstudio.com/docs/editor/extension-marketplace):
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), 用于格式化 TypeScript 和 Vue 文件.
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), 用于格式化 Scss 和其他文件.
- [Vue Language Features (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar), 为 *.vue 文件提供支持.
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin), TS 服务器识别 *.vue 文件.(建议启用 take over 模式, 启用方式请参照插件说明)
### 本体
需要说明的是, 脚本本体和功能是分开的两个项目. 本体的代码在 `src/` 下, 开发时产生 `dist/bilibili-evolved.dev.user.js` 文件. 功能的代码位于 `registry/` 下, 开发时在 `registry/dist/` 下产生文件.
@ -153,9 +155,7 @@ pnpm install
### 全局
全局变量, 无需 `import` 就可以直接使用. (Tampermonkey API 这里不再列出了, 可根据代码提示使用)
- `Vue`: Vue 库的主对象, 在创建 `.vue` 组件时, 其中的 `<script>` 可以直接使用 `Vue.extend()`
> 出于历史原因, 项目中用的还是 Vue 2, 由于其糟糕的 TypeScript 支持, 在 VS Code + Vetur 的环境下浏览 `.vue` 文件可能会报各种奇奇怪怪的类型错误, 无视就好. (类型是否正确以 `pnpm run type` 的结果为准)
- `Vue`: Vue 2 提供的主要对象. 不再推荐使用. 项目正处于 Vue 2.7 到 Vue 3 的过渡阶段, 建议优先使用组合式 API. 如果需要以选项式方式定义 Vue 组件, 请使用 `defineComponent` 而非 `Vue.extend``new Vue`.
- `lodash`: 包含所有 Lodash 库提供的方法
- `dq` / `dqa`: `document.querySelector``document.querySelectorAll` 的简写, `dqa` 会返回真实数组
> 在 `bwp-video` 出现后, 这两个查询函数还会自动将对 `video` 的查询扩展到 `bwp-video`

View File

@ -44,7 +44,7 @@
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "7.1.0",
"eslint-plugin-vue": "^9.15.1",
"fast-sass-loader": "^2.0.0",
"glob": "^10.2.6",
"postcss": "^8.1.0",
@ -60,8 +60,7 @@
"to-string-loader": "^1.2.0",
"ts-node": "^10.7.0",
"typescript": "^4.9.5",
"vue-loader": "^15.8.3",
"vue-template-compiler": "^2.6.11",
"vue-loader": "^15.10.1",
"webpack": "^5.31.2",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.6.0",
@ -78,7 +77,7 @@
"protobufjs": "^6.11.2",
"streamsaver": "^2.0.6",
"tippy.js": "^6.3.1",
"vue": "^2.6.11"
"vue": "^2.7.14"
},
"pnpm": {
"overrides": {

7527
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,9 @@
]
}
},
"vueCompilerOptions": {
"target": 2.7
},
"include": [
"src/**/*",
"tests/**/*",