草庐IT

language-ts

全部标签

c# - InvalidProgramException/Common Language Runtime 检测到无效程序

这是我很长时间以来看到的最奇怪的编程问题。我正在使用MicrosoftVisualC#2010Express、C#和.NET2.0开发应用程序。此应用程序引用了几个dll/程序集(这些dll都是在我的机器上生成的)。下面是部分代码(都是基本的东西):publicclassPowerManagement{[TestCase]publicvoidPrepareTest(){//Configureaccordingtopre-conditionsPreconditionsprecondition=newPreconditions();precondition.SetupPreconditio

vue3 vite ts引入vue文件报错 ts(2307)

vue3vitets生成的项目模板,在ts文件中引入vue文件报错ts(2307),只是ts报错,并不影响项目运行。官方文档有说明:http://vue.dragonlm.com/guide/typescript/overview.html#ide-support解决方法是安装插件,之后即可正常解析路径,并可以跳转到对应文件。TypeScriptVuePlugin(Volar)

Dr. LLaMA: Improving Small Language Models in Domain-Specific QAvia Generative Data Augmentation

https://arxiv.org/pdf/2305.07804.pdfhttps://arxiv.org/pdf/2305.07804.pdfOurfindingsindicatethatLLMseffectivelyrefineanddiversifyexistingquestion-answerpairs,resultinginimprovedperformanceofamuchsmallermodelondomain-specificQAdatasetsafterfine-tuning.ThisstudyhighlightsthechallengesofusingLLMsfordoma

uniapp+vue3+vite+ts搭建项目引入uni-ui和uviewPlus组件库

一、创建项目架构首先使用官方提供的脚手架创建一个项目在这里插入代码片,这里我创建的vue3+vite+ts的项目:npxdegitdcloudio/uni-preset-vue#vite-tsproject-name(如命令行创建失败,请直接访问gitee下载模板)[gitee](https://gitee.com/dcloud/uni-preset-vue/repository/archive/vite-ts.zip)二、下载依赖yarninstall启动yarndev:mp-weixinyarndev:h5三、下载安装包1.yarnadd@types/node-D2.yarnaddsass

Virtual script not found, may missing <script lang=“ts“> / “allowJs“: true / jsconfig.json. 报错解决

现在在用vue3+ts做项目,用volar做vue3语法指示器,遇到一些问题可能会报错。比如如下报错:Virtualscriptnotfound,maymissingscriptlang="ts">/"allowJs":true/jsconfig.json.volar虽然说项目还是可以正常运行,但是volar会给与蓝色波浪线的警示1、什么时候会出现这样的情况:如果我的script标签没有添加lang="ts"就会报这个错,2、出现的原因是:没有在配置中添加允许JS的配置(allowJs:true)3、如何解决?在tsconfig.js里面的compilerOptions对象下添加属性:“all

c# - Razor 智能感知错误 : Feature 'extension method' cannot be used because it is not part of the ISO-2 C# language specification

目标:使用cshtmlRazor模板格式化数据将cshtmlRazor模板作为嵌入式资源嵌入到类库中在cshtml模板中使用Linq语句和扩展方法我创建了一个新的类库项目,然后改编了ScottHanselman's有关如何将MVC3集成到WebForms应用程序以使其在类库中工作的说明。然后我使用NuGet包RazorEngine将模板应用于对象。到目前为止,它运行良好,但有一个问题:在编辑cshtml文件时,智能感知无法识别Linq语句或扩展方法(MVC的一个非常重要的部分)。因此对于以下cshtml文件:@modelCustomer[]@Model.Count()@if(Model

c# - Razor 智能感知错误 : Feature 'extension method' cannot be used because it is not part of the ISO-2 C# language specification

目标:使用cshtmlRazor模板格式化数据将cshtmlRazor模板作为嵌入式资源嵌入到类库中在cshtml模板中使用Linq语句和扩展方法我创建了一个新的类库项目,然后改编了ScottHanselman's有关如何将MVC3集成到WebForms应用程序以使其在类库中工作的说明。然后我使用NuGet包RazorEngine将模板应用于对象。到目前为止,它运行良好,但有一个问题:在编辑cshtml文件时,智能感知无法识别Linq语句或扩展方法(MVC的一个非常重要的部分)。因此对于以下cshtml文件:@modelCustomer[]@Model.Count()@if(Model

类型“AxiosResponse<any, any>”上不存在属性“errorinfo”。ts(2339)真实有效。

先看问题类型“AxiosResponse”上不存在属性“errorinfo”。ts(2339)接口是返回有这个字段的,但是依然飘红,尝试了好多方法不行。解决方法:请求封装文件里面加importaxios,{Axios,AxiosResponse,AxiosRequestConfig}from"axios";//处理类型“AxiosResponse”上不存在属性“errorinfo”。ts(2339)脑壳疼!关键一步。declaremodule"axios"{interfaceAxiosResponse{errorinfo:null;//这里追加你的参数}exportfunctioncreate

Node笔记 ts-node 报错 ERR_UNKNOWN_FILE_EXTENSION

发生背景项目里想用ts-node跑个脚本,执行:$npminstall-gts-node$ts-node./scripts/html-gen.ts代码是TypeScript+ESModule(真香),于是ts-node开始抱怨:TypeError[ERR_UNKNOWN_FILE_EXTENSION]:Unknownfileextension".ts"for...\scripts\html-gen.tsatnewNodeError(node:internal/errors:399:5)atObject.getFileProtocolModuleFormat[asfile:](node:inte

vue3+ts使用websocket 实现实时推送消息

因业务需要,做大屏页面某一处需要不断推送消息,采用websocket技术;1.新建socket.ts在utils文件夹下新建socket.ts;exportdefaultclassSocket{//cb:存储回调函数constructor(url:string,cb:(data:any)=>void){this.url=url;this.cb=cb;this.connect();}privatereadonlyurl:string='';privatecb?:(data:any)=>void;//和服务端连接的socket对象privatews?:WebSocket;privateremain