* .vue, Visual Studio 2017 and TypeScript

Can I edit vuejs * .vue component files in Visual Studio 2017 with highlighting and intellisense support for HTML, TypeScript, and SCSS?

I am currently splitting various sections into 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>
+4
source share
5 answers

. HTML , , , CSS, JavaScript Razor (ASP.NET). . TypeScript SCSS , , .

VS. vuejs , . , .

( : , HTML SCSS VS. TypeScript, .)

+4

, Visual Studio 2017. (, scss)

:

  • vue-cli

  • VuePack - https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VuejsPack-18329

  • : dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

  • , , :

    dotnet new vue

    npm install

    . / Visual studio 2017.

    .vue. :

  • webpack.config.js, module = > , : { test: /\.vue$/, include: /ClientApp/, loader: 'vue-loader', options: { loaders: { js: 'awesome-typescript-loader?silent=true' } } },

  • TypeScript - Loading... - , tsconfig.json - :

    "awesomeTypescriptLoaderOptions": { "useWebpackText": true, "useCache": true, "useTranspileModule": true }

.


, :

http://www.dotnetcurry.com/aspnet/1383/modern-web-dev-aspnet-core-webpack-vuejs

https://github.com/MarkPieszak/aspnetcore-Vue-starter

https://herringtondarkholme.imtqy.com/2016/10/03/vue2-ts2/

+3

, Visual Studio Vue Vetur: https://github.com/vuejs/vetur
, Visual Studio.

+1

i django. , , , , , .

0

There is a Vue plugin for Visual Studio called VuePack, which will provide the best experience for the individual VUE VUE files located here: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.VuejsPack-18329

0
source

Source: https://habr.com/ru/post/1666665/


All Articles