This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextBox x:Name="TestTextBox" Grid.Column="1" HorizontalAlignment="Center" Height="23" TextWrapping="Wrap" VerticalAlignment="Center" Width="200"> | |
<TextBox.Style> | |
<Style TargetType="{x:Type TextBox}"> | |
<Setter Property="Text" Value="りんご"/> | |
<Style.Triggers> | |
<DataTrigger Binding="{Binding TestFlag}" Value="True"> | |
<Setter Property="Text" Value="バナナ"/> | |
</DataTrigger> | |
</Style.Triggers> | |
</Style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="my-class"> | |
サンプル{{sampleData}} | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'MyComponent', | |
data () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div v-if="sampleProp === 1">template A</div> | |
<div v-else-if="sampleProp === 2">template B</div> | |
<div v-else>template C</div> | |
</div> | |
</template> | |
<script> | |
export default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- template A と表示する。 --> | |
<my-component sampleProp="1"></my-component> | |
<!-- template B と表示する。 --> | |
<my-component sampleProp="2"></my-component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div>サンプル</div> | |
<slot /> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'MyComponent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<my-component> | |
<div>コンポーネントの外側から挿入したい要素</div> | |
<my-component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function () { | |
// ここに共通処理を書く。 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<!-- 省略 --> | |
</template> | |
<script> | |
import CommonFunction from "./CommonFunction"; | |
export default { | |
name: 'MyComponent', | |
methods: { | |
CommonFunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<button @click="increment"> | |
<div>Count: {{ count }}</div> | |
<div>Double: {{ double }}</div> | |
</button> | |
<template> | |
<script> | |
export default { | |
data: () => ({ | |
count: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<!-- 省略 --> | |
<template> | |
<script> | |
import { reactive, computed } from "vue"; | |
export default { | |
setup() { | |
const state = reactive({ | |
count: 0, | |
double: computed(() => state.count * 2) |