<template>
<view class="content">
<image class="logo" src="../../static/logo.png"></image>
<view>
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
});
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin: 200rpx auto 50rpx auto;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

- 发布:2024-07-10 10:10
- 更新:2024-07-15 10:15
- 阅读:317
【报Bug】vue2+ts+nvue 编译到安卓时报错:TS2688:Cannot find type definition file for 'uni-app-vue2'.
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10 专业版 22H2
手机系统: Android
手机系统版本号: Android 14
手机厂商: OPPO
手机机型: find x2
页面类型: nvue
vue版本: vue2
打包方式: 云端
项目创建方式: CLI
CLI版本号: v5.0.8
示例代码:
操作步骤:
编译到安卓报错
编译到安卓报错
预期结果:
.
.
实际结果:
.
.
bug描述:
vue2+ts,nvue页面编译报错:
09:51:02.304 项目 'm-ts-project' 编译成功。
09:51:02.324 [tsl] ERROR at ..:0
09:51:02.345 TS2688:Cannot find type definition file for 'uni-app-vue2'.
09:51:02.365 The file is in the program because:
09:51:02.385 Entry point of type library 'uni-app-vue2' specified in compilerOptions
09:51:02.406 ERROR Build failed with errors.
cli工程项目:v5.0.8
uniapp版本:v4.15
夫子仰慕者
有找到原因吗
2024-10-22 15:52