制作一个网站的费用,国外设计网站都有哪些,西安公司章程在哪里下载,用asp.net做的购物网站在组件中使用外部js代码实现数据改变
先创建js文件 编写一些组件代码 编写外部js代码 在组件的js中引入外部js 在 app.json中添加路径规则 组件代码
!--components/my-behavior/my-behavior.wxml--
viewview当前计数为{{count}}/view
v…
在组件中使用外部js代码实现数据改变
先创建js文件 编写一些组件代码 编写外部js代码 在组件的js中引入外部js 在 app.json中添加路径规则 组件代码
!--components/my-behavior/my-behavior.wxml--
viewview当前计数为{{count}}/view
viewbutton sizemini typeprimary bind:tapjiayi加一 /buttonbutton sizemini typeprimary bind:tapjianyi减一 /button
/view
/view// components/my-behavior/my-behavior.js
import {commonbehavior } from components/behaviors/common
Component({behaviors:[commonbehavior],/*** 组件的属性列表*/properties: {},/*** 组件的初始数据*/data: {},/*** 组件的方法列表*/methods: {}
})
/* components/my-behavior/my-behavior.wxss */
{component: true,usingComponents: {}
}
外部js代码
export const commonbehavior Behavior({data:{count:100},methods:{jiayi(){this.setData({ count : this.data.count1}) },jianyi(){this.setData({ count : this.data.count-1})},}})