slot test
This commit is contained in:
28
frontend/src/components/AppSelect.vue
Normal file
28
frontend/src/components/AppSelect.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<template v-slot:list>
|
||||
<div class="q-pa-md">
|
||||
ppppppp
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'appSelect',
|
||||
props: {
|
||||
name: String,
|
||||
type: String
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
selected: ref([]),
|
||||
},
|
||||
onMounted(() => {
|
||||
console.log('Mounted');
|
||||
axios.get('http://127.0.0.1:8000/api/v1/allapps')
|
||||
.then(res => console.log(res.data))
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
|
||||
|
||||
<q-dialog :model-value="visible" persistent>
|
||||
<q-card style="min-width: 350px">
|
||||
<q-card-section>
|
||||
@@ -9,12 +7,8 @@
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="q-pa-md">
|
||||
<q-table :title="name+'リスト'" :rows="rows" :columns="columns" row-key="name" :selection="type"
|
||||
v-model:selected="selected" />
|
||||
</div>
|
||||
<slot name="list"></slot>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="text-primary">
|
||||
<q-btn flat label="確定" v-close-popup @click="CloseDialogue('OK')" />
|
||||
<q-btn flat label="キャンセル" v-close-popup @click="CloseDialogue('Cancel')" />
|
||||
@@ -24,17 +18,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//import { bexContent } from 'quasar/wrappers'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'showDialog',
|
||||
props: {
|
||||
name:String,
|
||||
visible: Boolean,
|
||||
type:String,
|
||||
columns:[],
|
||||
rows:[]
|
||||
},
|
||||
emits: [
|
||||
'close'
|
||||
@@ -46,9 +34,8 @@ export default {
|
||||
}
|
||||
|
||||
return {
|
||||
CloseDialogue,
|
||||
selected: ref([]),
|
||||
}
|
||||
CloseDialogue
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
</div>
|
||||
<div class="q-pa-md">
|
||||
<q-btn label="アプリ選択" color="primary" @click="showDg()" />
|
||||
<show-dialog ref="appDg" :name="name" v-model:visible="show" :type="type" :columns="columns" :rows="rows" @close="closeDg"></show-dialog>
|
||||
<show-dialog v-model:visible="show">
|
||||
<app-select></app-select>
|
||||
</show-dialog>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +44,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import ShowDialog from 'components/ShowDialog.vue';
|
||||
import AppSelect from 'components/AppSelect.vue';
|
||||
import { ref } from 'vue'
|
||||
let name = 'アプリ'
|
||||
let show = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user