1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <template>
- <view>
- <block v-for="item in initModule" :key="item.id">
- <component :is="item.component" :dataVal="item.fields.dataVal" :attrs="item.fields.attrs"
- :styles="item.fields.styles" />
- </block>
- </view>
- </template>
- <script>
- import {
- getTemplatePages
- } from "@/api/template.js"
- import Mixin from "./Mixin.js"
- export default {
- mixins: [Mixin],
- data() {
- return {
- initModule: [],
- }
- },
- onLoad(opt) {
- const {
- type
- } = opt
- if (type || type == '0') {
- this.getPages(type)
- }
- },
- methods: {
- getPages(type) {
- getTemplatePages(type).then(res => {
- const {
- page_code_json
- } = res.data
- if (page_code_json && page_code_json.customPagePart) {
- this.initModule = page_code_json.customPagePart
- }
- })
- }
- }
- }
- </script>
- <style>
- </style>
|