GithubHelp home page GithubHelp logo

ttk-cli / uni-vue3-vite-ts-pinia Goto Github PK

View Code? Open in Web Editor NEW
340.0 340.0 101.0 942 KB

A template for uniapp with vue3.

License: MIT License

JavaScript 23.23% Shell 0.84% TypeScript 52.52% HTML 4.40% Vue 10.14% SCSS 8.87%
template uniapp vue3-typescript

uni-vue3-vite-ts-pinia's People

Contributors

allen-1998 avatar lgowen avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

uni-vue3-vite-ts-pinia's Issues

cz校验

image
image
选不到 scope和CustomScopes是为什么

微信小程序环境运行中断

控制台报错提示

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: EBUSY: resource busy or locked, lstat 'E:\DumpStack.log.tmp'
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (file:///E:/webExe/uni-vue3-vite-ts-pinia/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/watch.js:4246:10)
    at ReaddirpStream.NodeFsHandler._boundHandleError (file:///E:/webExe/uni-vue3-vite-ts-pinia/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/watch.js:2720:43)
    at ReaddirpStream.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'lstat',
  path: 'E:\\DumpStack.log.tmp'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

该如何解决

useInit hooks不完善,无法高效的管理生命周期和页面传参

在作者给出的test示例中,对于 useInit 是这样使用的:
onLoad(() => { const { pageName, pagePath, pageQuery } = useInit(); console.log(pageName, pagePath, pageQuery, 'pageName,pagePath, pageQuery'); });
此时存在问题:
解构出来的变量只允许在 onLoad 作用域中使用,无法提供给 template 使用。 我尝试过将 onLoad 生命周期也放入 useInit 进行管理,但出现了很奇怪的bug,最后失败了。

有没有更好的解决方案呢?我希望解构出来的变量可以在 setup 下作为全局变量使用,而不是只能在 onLoad 中使用的局部变量

编译成H5时运行时报错

Uncaught SyntaxError: The requested module '/node_modules/vue/dist/vue.runtime.esm-bundler.js?v=3a70dec7' does not provide an export named 'injectHook' (at uni-app.es.js:1:70)
image
请问作者试过类似情况吗

项目拉取npm安装之后运行报错

编译器版本:3.4.6(vue3)
vite v2.9.5

运行到android12 模拟器

报错信息1:
Browserslist: caniuse-lite is outdated. Please run: 10:44:03.434 npx browserslist@latest --update-db 10:44:03.442 Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

报错信息2:
[plugin:vite:load-fallback] Could not load /__uno.css (imported by src/main.ts): ENOENT: no such file or directory, open 'D:\__uno.css'
表现为只有tabs;

uniapp-cli 升级到最新的正式版 3.0.0-3061820230117001
npm i 之后报错
`npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @dcloudio/[email protected]
npm ERR! node_modules/@dcloudio/types
npm ERR! dev @dcloudio/types@"2.5.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @dcloudio/types@"^3.0.20" from @dcloudio/[email protected]
npm ERR! node_modules/@dcloudio/uni-app
npm ERR! @dcloudio/uni-app@"3.0.0-3061820230117001" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\PF37EXR8\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PF37EXR8\AppData\Local\npm-cache_logs\2023-02-21T02_47_09_258Z-debug-0.log`

之后 npm i --legacy-peer-deps
报错
`
10:53:14.919 failed to load config from D:\temp-storage\uni-vue3-vite-ts-pinia\vite.config.ts
10:53:14.919 error during build:
10:53:14.927 TypeError: vite.createFilter is not a function
10:53:14.934 at vuePlugin (D:\temp-storage\uni-vue3-vite-ts-pinia\node_modules@vitejs\plugin-vue\dist\index.cjs:2601:23)
10:53:14.935 at createPluginVueInstance (D:\temp-storage\uni-vue3-vite-ts-pinia\node_modules@dcloudio\vite-plugin-uni\dist\vue\options.js:17:12)
10:53:14.949 at uniPlugin (D:\temp-storage\uni-vue3-vite-ts-pinia\node_modules@dcloudio\vite-plugin-uni\dist\index.js:80:55)
10:53:14.950 at Object. (D:\temp-storage\uni-vue3-vite-ts-pinia\vite.config.ts:94:40)
10:53:14.963 at Module._compile (node:internal/modules/cjs/loader:1165:14)
10:53:14.967 at Object.require.extensions. [as .ts] (D:\temp-storage\uni-vue3-vite-ts-pinia\node_modules\vite\dist\node\chunks\dep-27bc1ab8.js:61679:20)
10:53:14.979 at Module.load (node:internal/modules/cjs/loader:1043:32)
10:53:14.980 at Function.Module._load (node:internal/modules/cjs/loader:878:12)
10:53:14.990 at Module.require (node:internal/modules/cjs/loader:1067:19)
10:53:14.991 at require (node:internal/modules/cjs/helpers:103:18)

`
升级vite
.2.9.5 > 3.2.4

运行报错

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack -> at useStore2 (app-service.js:1658:15) at useStore (app-service.js:1812:43) at (app-service.js:1818:29) at (app-service.js:2127:3)
救命啊老铁~

H5 打包后无法运行

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

image

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @unocss/preset-rem-to-px to v0.46.5
  • chore(deps): update dependency cz-customizable to v6.9.2
  • chore(deps): update dependency unocss to v0.46.5
  • chore(deps): update dependency unplugin-auto-import to v0.11.4
  • chore(deps): update dependency unplugin-vue-components to v0.22.9
  • chore(deps): update dependency vue-tsc to v0.40.13
  • chore(deps): update typescript-eslint monorepo to v4.33.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency pinia-plugin-persist-uni to v1.2.0
  • fix(deps): update dependency sass to v1.56.1
  • chore(deps): update commitlint monorepo to v17 (major) (@commitlint/config-conventional, commitlint)
  • chore(deps): update dependency @dcloudio/types to v3
  • chore(deps): update dependency @vue/eslint-config-typescript to v11
  • chore(deps): update dependency cz-customizable to v7
  • chore(deps): update dependency eslint to v8
  • chore(deps): update dependency eslint-plugin-prettier to v4
  • chore(deps): update dependency eslint-plugin-simple-import-sort to v8
  • chore(deps): update dependency eslint-plugin-vue to v9
  • chore(deps): update dependency husky to v8
  • chore(deps): update dependency stylelint-config-standard to v29
  • chore(deps): update dependency vite to v3
  • chore(deps): update dependency vue-tsc to v1
  • chore(deps): update typescript-eslint monorepo to v5 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @dcloudio/uni-app 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-app-plus 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-components 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-h5 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-alipay 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-baidu 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-kuaishou 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-lark 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-qq 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-toutiao 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-mp-weixin 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-quickapp-webview 3.0.0-alpha-3040720220422004
  • pinia 2.0.13
  • pinia-plugin-persist-uni 1.1.5
  • sass 1.49.9
  • vue 3.2.33
  • @commitlint/config-conventional 16.2.1
  • @unocss/preset-rem-to-px 0.45.1
  • @dcloudio/types 2.5.17
  • @dcloudio/uni-automator 3.0.0-alpha-3040720220422004
  • @dcloudio/uni-cli-shared 3.0.0-alpha-3040720220422004
  • @dcloudio/vite-plugin-uni 3.0.0-alpha-3040720220422004
  • @typescript-eslint/eslint-plugin 4.15.1
  • @typescript-eslint/parser 4.15.1
  • @vue/eslint-config-typescript 7.0.0
  • auto-import-types 0.0.4
  • autoprefixer 10.4.4
  • commitizen 4.2.4
  • commitlint 16.2.3
  • cz-customizable 6.3.0
  • eslint 7.32.0
  • eslint-config-prettier 8.3.0
  • eslint-plugin-import 2.26.0
  • eslint-plugin-prettier 3.3.1
  • eslint-plugin-simple-import-sort 7.0.0
  • eslint-plugin-vue 7.0.0
  • husky 7.0.4
  • pinia-auto-refs 0.0.4
  • postcss-html 1.3.0
  • postcss-scss 4.0.3
  • stylelint 14.1.0
  • stylelint-config-standard 24.0.0
  • stylelint-order 5.0.0
  • stylelint-scss 4.0.1
  • typescript 4.6.3
  • unocss 0.31.13
  • unplugin-auto-import 0.9.2
  • unplugin-vue-components 0.21.1
  • vite 2.9.5
  • vue-global-api 0.4.1
  • vue-tsc 0.29.3
  • node >=16.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

config/env.ts问价中获取环境变量和uni无法编译。

遇到一个奇怪的问题:
1.在src/config/env.ts中使用import.meta.env.MODE无法正常编译,其他文件可以使用。
2.在src/config/env.ts中使用uni的API无法正常编译(uni is not defined),其他文件可以使用。

微信小程序运行出错

微信小程序开发过程中app.wxss文件内会编译出*星号css选择器,导致运行时候报错

[自动热重载错误 WXSS 文件编译错误] ./app.wxss
unexpected token "*"

关于项目中使用了Prettier和ESLint发生了冲突的问题解决方案

我看作者您在.vscode/settings.json中关闭了自动保存和eslint修复,想必原因是因为保存的时候,eslint语法修正和prettier语法美化之间会发生冲突格式化,其实很简单的解决思路就是直接把项目中所有有关prettier的依赖和配置都删除掉,默认使用eslint的格式化也是很不错的方案。

可以参考前端大神antfu的专题文章:

《为什么我不使用 Prettier》 - https://antfu.me/posts/why-not-prettier-zh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.