From 3b03f87a02458f719e2eb4bf112a13441b427d14 Mon Sep 17 00:00:00 2001 From: ‘chensiAb’ <‘chenchenco03@163.com’> Date: Tue, 25 Mar 2025 13:54:34 +0800 Subject: [PATCH] Merge branch 'master' of ssh://dev.zhiheiot.com:29418/mob-components --- _cursor.ai/rules/type-component.mdc | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-) diff --git a/_cursor.ai/rules/type-component.mdc b/_cursor.ai/rules/type-component.mdc new file mode 100644 index 0000000..8d4918b --- /dev/null +++ b/_cursor.ai/rules/type-component.mdc @@ -0,0 +1,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> +``` -- Gitblit v1.9.1