index.html ファイルで Enyo アプリ クラスを作成するときに、パラメータを渡そうとしました。私はそれをテストするために以下を持っています
new MyApps.MainApp("test").renderInto(document.body);
そしてjsファイルで
create: function(in)
{
Alert(in);
}
これを行う方法はありますか?
index.html ファイルで Enyo アプリ クラスを作成するときに、パラメータを渡そうとしました。私はそれをテストするために以下を持っています
new MyApps.MainApp("test").renderInto(document.body);
そしてjsファイルで
create: function(in)
{
Alert(in);
}
これを行う方法はありますか?
あなたは本当に、本当に近いです。アプリの種類にいくつかの変数を設定する場合は、他の種類の場合と同じようにパラメーターを渡す必要があります。試す:
new MyApps.MainApp({test: true}).renderInto(document.body);
次に、次のように test の値にアクセスできるはずです: this.test
それが役立つことを願っています。
new MyApps.MainApp({test: true}).renderInto(document.body);
...
enyo.kind({
name: "MyApps.MainApp",
kind: enyo.VFlexBox,
components: [],
create: function(inArgs) {
var args = inArgs;
if (args.test) {
this.log("SUCCESS");
}
this.inherited(arguments);
}
});
そんな感じ。