Vue.js, Visual Studio 2015 and .less styles syntax highlighting -
i using visual studio 2015 , vue.js implement frontend web app.
as known, vue.js comes quite special approach declare components - each component should declared in single .vue
file, contains required code (template, script , style) , looks this:
<template> <!-- component template goes here. --> </template> <script> <!-- component code goes here. --> </script> <style> <!-- component style goes here. --> </style>
there no official support .vue files in msvs @ moment, use html editor edit files , works fine me.
so, problem...
vue-files allows set required language script or style (just add lang
attribute script
or style
tags , here go). so, using less, style tag looks this:
<style lang="less">...</style>
visual studio, of course, know nothing special lang attribute, add well-known attributes in order enable less syntax highlighting , style tag looks this:
<style lang="less" rel="stylesheet/less" type="text/less">...</style>
unfortunately visual studio don't understand intention use less , highlight less code simple css :-(
so, question is: how let visual studio understand .less styles, embedded right html document?
p.s. allowed reference separate files part of .vue component this...
<template src="./template.html"></template> <style src="./style.css"></style> <script src="./script.js"></script>
...but want store inside single file.
and, of course, want use single ide both frontend , backend, advice "just use visual studio code, sublimetext or webstorm" not useful.
there vue.js pack visual studio provides intellisense visual studio 2015.
https://marketplace.visualstudio.com/items?itemname=madskristensen.vuejspack
Comments
Post a Comment