1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- // myComponents/formItem/formItem.js
- Component({
- options:{
- multipleSlots: true // 在组件定义时的选项中启用多slot支持
- },
- /**
- * 组件的属性列表
- */
- properties: {
- label:{
- type:String,
- value:''
- },
- labelWidth:{
- type:Number,
- value:'',
- },
- labelPosition:{
- type:String,
- value:'left'
- },
- customClass:{
- type:String,
- value:''
- },
- required:{
- type:Boolean,
- value:false
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
-
- },
- lifetimes: {
- // 在组件实例进入页面节点树时执行
- attached: function () {
- // 初始化操作
- // console.log('组件初始化');
- // ...
- },
- // 在组件实例被移除出页面节点树时执行
- detached: function () {
- // 清理工作
- console.log('组件销毁');
- // ...
- },
- // ...
- },
- /**
- * 组件的方法列表
- */
- methods: {
-
- }
- })
|