剃刀助手语法自动格式化丑。怎么修? [英] Razor Helper Syntax Auto Formatting Ugly. How to fix?

查看:159
本文介绍了剃刀助手语法自动格式化丑。怎么修?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我只是用Visual Studio格式的剃须刀代码的方式有一个牛肉。我一直对Visual Studio有一些问题,它是如何格式化UI代码的,它似乎总是做一个真正的超级糟糕的工作,业界不希望遵循。

<所以这个例子看起来真正的愚蠢。我试图找出是否有mods或方法来解决这个问题。这看起来真的很不好。



任何人都知道这件事? lol

  @using Company.Mobile2.Enums 
@helper BidsByShipment(string generatedId,int bidsCount,int activeBidsCount)
{
if(bidsCount> 0)
{
@if(activeBidsCount> 0)
{
< text> @bidsCount(@activeBidsCount @GetStr(Company))< / text>
}
else
{
< text> @ bidsCount< / text>
}
< / a>
}
else
{
< text> 0 @GetStr(Company)< / text>



$ div $解析方案

显然目前没有办法解决这个问题,这是他们在另一个相关的问题中所回答的:为什么Visual Studio代码格式不能正确的使用Razor标记?


So I just have a beef with the way Visual Studio formats razor code. I've always had some problems with visual studio and how it formats UI code, it always seems to do a real super bad job that the industry doesn't want to follow.

So the example looks real real stupid. And I'm trying to figure out if there are mods or ways to fix this issue. It just looks real real bad.

Anyone know anything about this? lol

@using Company.Mobile2.Enums
@helper BidsByShipment(string generatedId, int bidsCount, int activeBidsCount)
    {
        if (bidsCount > 0)
        {
    <a class="Company-listview-link Company-listview-bids" href="/Shipping/Bids/ByShipment?id={0}">
        @if (activeBidsCount > 0)
        {
            <text>@bidsCount (@activeBidsCount @GetStr("Company"))</text>
        }
        else
        {
            <text>@bidsCount</text>
        }
    </a>
        }
        else
        {
    <text>0 @GetStr("Company")</text>
        }
}

解决方案

Apparently there's no way around it for the moment, this is what they have answered in another related question: Why doesn't Visual Studio code formatting work properly for Razor markup?

这篇关于剃刀助手语法自动格式化丑。怎么修?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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