docBeHavior.js
javascript
module.exports = Behavior({
//属性节点
properties: {
},
//私有数据节点
data: {
showReName: false,
showDelete:false,
showMove: false,
},
//其它节点
methods: {
deleteClick(e) {
this.setData({showDelete: true})
},
reNameClick(e) {
this.setData({showReName: true})
},
moveClick(e) {
this.getUserDir();
this.setData({showMove: true})
},
}
});
引用
代码
javascript
const docBehavior = require("../../../behaviors/docBehavior.js");
Page({
/**
* 页面的初始数据
*/
behaviors:[
docBehavior
],
data: {
},
})
页面直接使用