Last active
June 7, 2021 12:11
-
-
Save sawa060/62b5b83ce96dabc8758ea03d3b037680 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<b-table> | |
<b-thead> | |
<b-tr> | |
<b-th class="text-left small text-muted border-top-0" style="width:15%;">名前</b-th> | |
<b-th class="text-left small text-muted border-top-0" style="width:25%;" v-if="isRecordButton">メモ</b-th> | |
</b-tr> | |
</b-thead> | |
<b-tbody> | |
<template v-for="(pattern, index) in patterns"> | |
<b-tr :key="pattern.id"> | |
<b-td>{{ pattern.name }}</b-td> | |
<b-td> | |
<button @click="openMemo">メモ記入</button> | |
<memo-modal v-if="memoModalOpen"> | |
<div class="text-center"> | |
<p>{{ pattern.name }}</p> | |
<p>メモ</p> | |
</div> | |
<div> | |
<b-form-textarea | |
id="`pattern_memo_${index}`" | |
:name="`pattern_memo_${index}`" | |
v-model="patterms[index].memo" > | |
</b-form-textarea> | |
</div> | |
<template slot="footer"> | |
<b-button @click="closeMemo">閉じる</b-button> | |
</template> | |
</memo-modal> | |
</b-td> | |
</b-tr> | |
</b-tbody> | |
</template> | |
<script> | |
/** MemoModalをインポート */ | |
import MemoModal from '~/components/sample/MemoModal.vue' | |
export default { | |
components: { 'memo-modal': MemoModal }, | |
data: () => { | |
return { | |
patterns: [ | |
{id: 1, name: test1, memo: ''}, | |
{id: 2, name: test2, memo: ''}, | |
{id: 3, name: test3, memo: ''}, | |
], | |
memoModalOpen: false | |
} | |
}, | |
methods: { | |
openMemo() { | |
this.memoModalOpen = true | |
}, | |
closeMemo() { | |
this.memoModalOpen = false | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
フォーマッター適用後のソース(
<template v-for="(pattern, index) in patterns">
の閉じタグが無いのでそれも追加)