Home > front end >  WeChat small program a js file, two functions using the same variables
WeChat small program a js file, two functions using the same variables

Time:09-19

Page (

Data (
A is 1

)
F1 funtion output for a=2 (a)
Now I want to in the function f2 directly using a=2 this value

How to implement

CodePudding user response:

As a global variable, to perform first f1, perform f2 can again,

CodePudding user response:

F1 funtion ()
Var that=this
That. SetDAta (
A: 2
)
  • Related