other components... (2)
This commit is contained in:
0
src/components/CMyInnerPage/CMyInnerPage.scss
Executable file
0
src/components/CMyInnerPage/CMyInnerPage.scss
Executable file
37
src/components/CMyInnerPage/CMyInnerPage.ts
Executable file
37
src/components/CMyInnerPage/CMyInnerPage.ts
Executable file
@@ -0,0 +1,37 @@
|
||||
import { defineComponent, ref, onMounted } from 'vue'
|
||||
import { IMyPage } from 'model'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { CImgText } from '@/components/CImgText'
|
||||
import { CCard } from '@/components/CCard'
|
||||
import { CMyPage } from '@/components/CMyPage'
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyInnerPage',
|
||||
props: {
|
||||
path: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
components: { CImgText, CCard, CMyPage, CTitleBanner },
|
||||
setup(props) {
|
||||
// const heightimg
|
||||
// const imgback
|
||||
const rec = ref(<IMyPage | undefined>{})
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
function mounted() {
|
||||
// console.log('$route.path', $route.path)
|
||||
rec.value = globalStore.getPage(props.path)
|
||||
console.log(rec)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
rec,
|
||||
}
|
||||
},
|
||||
|
||||
})
|
||||
22
src/components/CMyInnerPage/CMyInnerPage.vue
Executable file
22
src/components/CMyInnerPage/CMyInnerPage.vue
Executable file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="rec">
|
||||
<!--<CMyPage :title="rec.title" :imgbackground="`statics/` + rec.imgback" :sizes="`max-height: ` + rec.heightimg + `px`">-->
|
||||
|
||||
<div class="q-ma-sm q-gutter-sm q-pa-xs">
|
||||
<div v-if="rec.content" v-html="rec.content">
|
||||
</div>
|
||||
</div>
|
||||
<!--</CMyPage>-->
|
||||
</div>
|
||||
<div v-else>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./CMyInnerPage.ts">
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'CMyInnerPage.scss';
|
||||
</style>
|
||||
1
src/components/CMyInnerPage/index.ts
Executable file
1
src/components/CMyInnerPage/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CMyInnerPage} from './CMyInnerPage.vue'
|
||||
Reference in New Issue
Block a user