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>
|
<template>
|
||||||
<div class="q-pa-md q-gutter-sm">
|
<div class="q-pa-md q-gutter-sm">
|
||||||
|
|
||||||
|
|
||||||
<q-dialog :model-value="visible" persistent>
|
<q-dialog :model-value="visible" persistent>
|
||||||
<q-card style="min-width: 350px">
|
<q-card style="min-width: 350px">
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
@@ -9,46 +7,35 @@
|
|||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-card-section class="q-pt-none">
|
<q-card-section class="q-pt-none">
|
||||||
<div class="q-pa-md">
|
<slot name="list"></slot>
|
||||||
<q-table :title="name+'リスト'" :rows="rows" :columns="columns" row-key="name" :selection="type"
|
|
||||||
v-model:selected="selected" />
|
|
||||||
</div>
|
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
||||||
<q-card-actions align="right" class="text-primary">
|
<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('OK')" />
|
||||||
<q-btn flat label="キャンセル" v-close-popup @click="CloseDialogue('Cancel')"/>
|
<q-btn flat label="キャンセル" v-close-popup @click="CloseDialogue('Cancel')" />
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
//import { bexContent } from 'quasar/wrappers'
|
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name:'showDialog',
|
name: 'showDialog',
|
||||||
props: {
|
props: {
|
||||||
name:String,
|
visible: Boolean,
|
||||||
visible:Boolean,
|
|
||||||
type:String,
|
|
||||||
columns:[],
|
|
||||||
rows:[]
|
|
||||||
},
|
},
|
||||||
emits:[
|
emits: [
|
||||||
'close'
|
'close'
|
||||||
],
|
],
|
||||||
setup(props,context) {
|
setup(props, context) {
|
||||||
const CloseDialogue =(val) =>{
|
const CloseDialogue = (val) => {
|
||||||
context.emit('update:visible',false);
|
context.emit('update:visible', false);
|
||||||
context.emit('close',val);
|
context.emit('close', val);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
CloseDialogue,
|
CloseDialogue
|
||||||
selected: ref([]),
|
}
|
||||||
}
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -31,7 +31,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="q-pa-md">
|
<div class="q-pa-md">
|
||||||
<q-btn label="アプリ選択" color="primary" @click="showDg()" />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -42,6 +44,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ShowDialog from 'components/ShowDialog.vue';
|
import ShowDialog from 'components/ShowDialog.vue';
|
||||||
|
import AppSelect from 'components/AppSelect.vue';
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
let name = 'アプリ'
|
let name = 'アプリ'
|
||||||
let show = ref(false);
|
let show = ref(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user