Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/assets/vue/components/page/PageCard.vue

54 lines
981 B

<template>
<q-card
v-if="page"
elevation="4"
>
<q-card-section>
<div class="text-h6">
{{ page.title }}
</div>
</q-card-section>
<q-card-section>
<p v-html="page.content" />
</q-card-section>
<q-card-actions v-if="isAdmin">
<q-btn
v-close-popup
flat
label="Edit"
color="primary"
@click="handleClick(page)"
/>
</q-card-actions>
</q-card>
</template>
<script>
import {mapGetters} from "vuex";
import {useRouter} from "vue-router";
import {reactive, toRefs} from "vue";
export default {
name: 'PageCard',
props: {
page: Object,
},
setup() {
const router = useRouter();
const state = reactive({
handleClick: function (page) {
router.push({name: 'PageUpdate', query: {id: page['@id']}});
},
});
return toRefs(state);
},
computed: {
...mapGetters({
'isAdmin': 'security/isAdmin',
}),
}
};
</script>