Fxiaoke Developer Manual Fxiaoke Developer Manual
  • APL Development Manual
  • PWC Development Manual
  • OpenAPI Documentation
  • Custom Components (PC)
  • Custom Components (Mini Program)
  • Custom Plugins (PC)
  • Custom Plugins (Mini Program)
  • Third-party Integration Plugins (H5)
  • API (PC)
  • API (Mini Program)
  • Fx DevTools
Update Log
  • 简体中文
  • English
  • Custom Components (PC)
  • Custom Components (Mini Program)
  • Custom Plugins (PC)
  • Custom Plugins (Mini Program)
  • Third-party Integration Plugins (H5)
  • API (PC)
  • API (Mini Program)
  • Fx DevTools
Update Log
  • 简体中文
  • English
  • Getting Started

    • What is Custom Component
    • Develop Your First Custom Component
    • Usage Scenarios
    • Multi-file Custom Components
      • Example: A custom component with the following files
    • Using Static Assets in Custom Components
    • Using FxUI
  • Components

  • Examples

  • FAQ

Table of Contents

Multi-file Custom Components

# Multi-file Custom Components

For complex custom components, UI-PaaS supports splitting them into multiple files to achieve a clearer and more logical code structure.

# Example: A custom component with the following files

  • secondComponent.vue (entry)
  • subComponent.vue
  • helper.js

Code: secondComponent.vue

<template>  
    <div style="width: 100%;">  
        Hello: {{myName}}  
        <subComponent></subComponent>  
    </div>  
</template>  
<script>  
import subComponent from './subComponent';  
import helper from './helper';  
export default {  
    components: {  
        subComponent  
    },  
    data() {  
        return {  
            myName: "Developer"  
        }  
    }  
}  
</script>  

Code: subComponent.vue

<template>  
    <div style="width: 100%;">  
        Hello: subComponent  
    </div>  
</template>  
<script>  
export default {  
}  
</script>  

Code: helper.js

export default {  
    formatData() {  
        return {};  
    }  
}  
Usage Scenarios
Using Static Assets in Custom Components

← Usage Scenarios Using Static Assets in Custom Components→

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式