我使用 prettier 来格式化我的代码。如何根据反应代码中的花括号配置更漂亮以添加空格?
当前代码:
<AdminPanel
theme={myTheme}
dataProvider={dataProvider}
authProvider={authProvider}
history={history}
/>
Run Code Online (Sandbox Code Playgroud)
预期结果:
<AdminPanel
theme={ myTheme }
dataProvider={ dataProvider }
authProvider={ authProvider }
history={ history }
/>
Run Code Online (Sandbox Code Playgroud) 我正在尝试将xaml中TextBlock的'Text'属性绑定到全局字符串,但是当我更改字符串时,TextBlock的内容不会改变.我错过了什么?
我的xaml:
<StackPanel>
<Button Content="Change!" Click="Button_Click" />
<TextBlock Text="{x:Bind text}" />
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
我的C#:
string text;
public MainPage()
{
this.InitializeComponent();
text = "This is the original text.";
}
private void Button_Click(object sender, RoutedEventArgs e)
{
text = "This is the changed text!";
}
Run Code Online (Sandbox Code Playgroud)