使用Page 构造器注册小程序页面
初始化页面数据
实时生命周期监听
注册自定义方法
// index.js
Page({
//1,初始化页面数据
data:{
name:”coderMonkey index”,
age:100
},
//2,生命周期的监听
onLoad(){
console.log(“index onload”)
},
//3,自定义事件处理
sayHellow(){
console.log(“hellow world”)
}
})
使用Page 构造器注册小程序页面
初始化页面数据
实时生命周期监听
注册自定义方法
// index.js
Page({
//1,初始化页面数据
data:{
name:”coderMonkey index”,
age:100
},
//2,生命周期的监听
onLoad(){
console.log(“index onload”)
},
//3,自定义事件处理
sayHellow(){
console.log(“hellow world”)
}
})
发表回复