我的团队使用基于类的组件和打字稿在 Vue 2 中开发应用程序。
现在,我们想迁移到 Vite - 因为它具有所有优势。
我已遵循本指南(我只能推荐) https://vueschool.io/articles/vuejs-tutorials/how-to-migrate-from-vue-cli-to-vite/
简而言之 - 它不起作用。浏览器甚至无法从 index.html 获取“/src/main.js”,但是如果我输入“/src/main.ts”,它会获取它,但会显示错误,表明 Vuetify 甚至没有安装。我知道浏览器无法读取.ts文件,我只是在调试了2小时后尝试了它
另外,我在 Vuetify 文档中看到“第一方 Vite 支持”仍有待发布。 https://vuetifyjs.com/en/introduction/roadmap/#in-development
我的问题是 -是否可以在 Vite 应用程序中添加 Vuetify ?
package.json(仅依赖项)
"dependencies": {
"vue": "^2.6.12",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2",
"vuetify": "^2.4.0",
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@vitejs/plugin-vue": "^1.6.1",
"@vue/cli-plugin-typescript": "^4.5.15",
"@vue/eslint-config-typescript": "^7.0.0",
"eslint": "^8.9.0",
"eslint-plugin-vue": "^8.5.0",
"sass": "~1.32.0",
"typescript": "~4.1.5",
"vite": "^2.6.13",
"vite-plugin-vue2": "^1.9.2",
"vue-cli-plugin-vuetify": "^2.4.5",
"vue-template-compiler": "^2.6.14",
"vuetify-loader": "^1.7.0"
},
Run Code Online (Sandbox Code Playgroud)
tsconfig.json
{
"compilerOptions": {
// ... …Run Code Online (Sandbox Code Playgroud) 如何在我的angular2项目中创建一个下载按钮以将HTML div内容另存为PDF文件?
这是HTML内容
<div id="obrz">
<br><br>
<p class="float-right font-weight-bold">??????? ???</p>
<br>
<p class="float-left font-weight-bold">?????? ? ?????????:</p>
<br>
<div class="row" style="width:100%">
<div class="col-md-2"><p>??????? ????????:</p></div>
<div class="col-md-10"><input value="{{userModel.imeIprezime}}" type="text" class="form-control form-control-sm border-1 border-top-0 border-right-0 border-left-0" style="border-bottom: 1px solid black"></div>
<div class="col-md-2"><p>???:</p></div>
<div class="col-md-10"><input value="{{userModel.PIB}}" type="text" class="form-control form-control-sm border-1 border-top-0 border-right-0 border-left-0" style="border-bottom: 1px solid black"></div>
<div class="col-md-2"><p>??????:</p></div>
<div class="col-md-10"><input value="{{userModel.ulica + ' ' + userModel.broj + ' ' + userModel.grad}}" type="text" class="form-control form-control-sm border-1 border-top-0 border-right-0 border-left-0" style="border-bottom: 1px solid black"></div>
<div …
Run Code Online (Sandbox Code Playgroud)