*.vue 文件,Visual Studio 2017 &打字稿 [英] *.vue files, Visual Studio 2017 & TypeScript

查看:32
本文介绍了*.vue 文件,Visual Studio 2017 &打字稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Visual Studio 2017 中编辑 vuejs 的 *.vue 组件文件,并支持高亮和智能感知HTML、TypeScript 和 SCSS?

目前,我将不同的部分分离到不同的文件中:

<模板><div>文本

<script src="./path/to/my-component.ts"></script><style src="./path/to/my-component.scss"></style>

解决方案

目前答案是否定的.HTML 编辑器知道一些可以托管的语言,例如 CSS、JavaScript 和 Razor (ASP.NET).在这些情况下,编辑器会做一些奇特的事情来将文本的各个部分映射到每种语言服务.但是,TypeScript 和 SCSS 目前不支持,据我所知,这两个团队都不在待办事项中.

请使用 VS 反馈工具提出请求.由于 vuejs 支持这一点,因此它具有一定的权重,并且可能会被考虑到未来的功能规划中.客户报告有时比我的更重要.

(完全披露:我在拥有 VS 中 HTML 和 SCSS 编辑器的团队工作.我们不拥有 TypeScript,但我们与团队合作处理此类事情.)

Is it possible to edit vuejs's *.vue component files in Visual Studio 2017 with highlighting and intellisense support for HTML, TypeScript AND SCSS?

At the moment, I'm separating the different sections to different files:

<!-- my-component.vue opened in HTML editor -->
<template>
    <div> text </div>
</template>
<script src="./path/to/my-component.ts"></script>
<style src="./path/to/my-component.scss"></style>

解决方案

Currently the answer is no. The HTML editor is aware of some languages that can be hosted, such as CSS, JavaScript, and Razor (ASP.NET). In these cases, the editor does some fancy things to map sections of the text to each language service. However, TypeScript and SCSS do not support that at the moment, and as far as I know it's not on the backlog for either team.

Please request this using the VS Feedback tool. Since vuejs support this, it bears some weight and may get taken into account for future feature planning. A customer report can sometimes carry more weight than mine.

(Full Disclosure: I work on the team that owns the HTML and SCSS editors in VS. We don't own TypeScript, but we work with the team for things like this.)

这篇关于*.vue 文件,Visual Studio 2017 &amp;打字稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆