Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在组件的“init”函数中定义一个变量,我可以在所有组件函数中访问该变量。
使用变量作用域,这是组件私有的,并且在组件内的任何函数中都可用
function init(somevalue) { variables.somevalue = arguments.somevalue } function getSomeValue() { return variables.somevalue; }