Vue3.0+ts填坑 Module Warning...error Unexpected tab character...19 problems (19 errors, 0 warnings)

  • ( 一般都是格式化后的错误)
    在这里插入图片描述

  • 用Standard标准创建的项目(它是一些前端工程师自定的标准)
    在这里插入图片描述
    或者下载这个依赖:eslint-config-standard

     npm install eslint-config-standard eslint-plugin-standard eslint-plugin-promise -g
    
  • 创建的项目的目录是这个样子的,会有一个 .editorconfig 文件
    在这里插入图片描述

  • .editorconfig文件 要配合vscode的插件使用,下载插件

     	EditorConfig for VS Code
    

    在这里插入图片描述

  • 在.editorconfig文件 写入以下代码

    	# 告诉EditorConfig插件,这是根文件,不用继续往上查找
    	root = true
    
    	# 匹配全部文件
    	[*]
    
    	# 设置字符集
    	charset = utf-8
    
    	# 缩进风格,可选"space""tab"
    	indent_style = space
    
    	# 缩进的空格数
    	indent_size = 2
    
    	# 结尾换行符,可选"lf""cr""crlf"
    	end_of_line = lf
    
    	# 在文件结尾插入新行
    	insert_final_newline = true
    
    	# 删除一行中的前后空格
    	trim_trailing_whitespace = true
    

    .editorconfig文件配置官网:https://editorconfig.org/

  • 重启项目就可以了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
你好!对于使用Vue 3、TypeScript和Vite来实现一个看房自由的应用,可以结合Three.js这个D图形库来实现。下面是一个简单的步骤指南: 1. 首先,确保你已经安装了Node.js和npm。 2. 创建一个新的Vue项目,可以使用Vue CLI来快速搭建一个基本的项目结构。 ```bash npm install -g @vue/cli vue create my-project ``` 3. 在Vue项目中安装Vite作为开发服务器。 ```bash cd my-project npm install -D create-vite npx create-vite ``` 4. 安装Three.js库和相关依赖。 ```bash npm install three ``` 5. 在Vue组件中引入Three.js库,并开始编写代码来实现看房自由功能。 ```typescript <template> <div ref="container"></div> </template> <script lang="ts"> import { ref, onMounted } from 'vue'; import * as THREE from 'three'; export default { setup() { const container = ref(null); onMounted(() => { // 创建场景、相机和渲染器 const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const renderer = new THREE.WebGLRenderer(); // 设置渲染器的大小并将其添加到DOM中 renderer.setSize(window.innerWidth, window.innerHeight); container.value.appendChild(renderer.domElement); // 创建一个立方体并将其添加到场景中 const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); // 设置相机的位置 camera.position.z = 5; // 动画循环 const animate = function () { requestAnimationFrame(animate); // 使立方体旋转起来 cube.rotation.x += 0.01; cube.rotation.y += 0.01; // 渲染场景和相机 renderer.render(scene, camera); }; animate(); }); return { container, }; }, }; </script> <style> #container { width: 100%; height: 100%; } </style> ``` 这只是一个简单的示例,你可以根据自己的需求来构建更复杂的场景和交互逻辑。希望对你有所帮助!如有任何疑问,欢迎继续提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

苟圣啊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值