WebApp【公共组件库】@前端(For Git Submodule)
‘chensiAb’
2025-04-01 e7b2533bf1c746649a154dc2025096e6ddb5a456
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
description: 
globs: src/pages/**/**/cmpt/*.vue,src/components/**/**/*.vue
alwaysApply: false
---
 
# 界面子组件&公共组件
 
界面子组件与公共组件,就是一个普通 Vue 组件
 
## 子组件空白模板
 
```html
/**
 * CExample - 示范组件
 * @author Tevin
 */
 
<template>
    <view class="c-example">
        <!-- 组件内容 -->
        <AtButton
            type="primary"
            size="small"
            :onClick="evt => handleOpen()"
        >示例按钮</AtButton>
    </view>
</template>
 
<script>
import Taro from '@tarojs/taro';
import { AtButton } from 'taro-ui-vue';
import './cExample.scss';
 
export default {
    name: 'CExample',
    components: {
        AtButton,
    },
    props: {
        onOpened: Function,
    },
    data() {
        return {
        };
    },
    computed: {
    },
    methods: {
        handleOpen() {
            this.onOpened();
        }
    },
    mounted() {},
};
</script>
```