Files
ClassContent/历届学生/front-end-team-11/项目开发/上课项目/minstudy/components/header/header.js
2024-09-27 02:06:13 +08:00

40 lines
589 B
JavaScript

// components/header/header.js
Component({
options: {
multipleSlots: true
},
/**
* 组件的属性列表
*/
properties: {
title: {
type: String,
value: "默认数值"
}
},
/**
* 组件的初始数据
*/
data: {
test: '测试数据,哈哈哈哈'
},
observers: {
'test': function (newTest) {
console.log("newTest: ", newTest);
}
},
/**
* 组件的方法列表
*/
methods: {
test() {
this.setData({
test: "你好"
})
this.triggerEvent("change", this.data.test)
}
}
})