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

49 lines
989 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 flat label="Edit" color="primary" v-close-popup @click="handleClick(page)"/>
</q-card-actions>
</q-card>
</template>
<script>
import {mapGetters, useStore} 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`, params: {id: page['@id']}})
.catch(() => {
});
},
});
return toRefs(state);
},
computed: {
...mapGetters({
'isAdmin': 'security/isAdmin',
}),
}
};
</script>