extjs文件放在哪里?
Where to put extjs file?
我在 GitHub 上遇到了我想在我的应用程序中使用的 extjs class。
我应该把那个文件放在哪里?
我知道 extjs 中的文件结构遵循一些模式,所以例如如果我的应用程序的名称是 MyApp,那么我将 classes 放在相应的文件夹中,例如 MyApp.view.myfolder.MyClass
.
但是,在这种情况下,class 的用法为
GLC.tip.toast(title, message, options)
所以我怀疑我是否应该将它放在某个视图文件夹中。另一方面,我尝试将这两个文件(glc_tip.js 和 tip.scss)复制到我的应用程序的根文件夹中,并在 index.html 中包含以下行:
<script type="text/javascript" src="glc_tip.js"/>
但它也不起作用。我收到一个未定义的错误。
更新
我在应用程序根目录中创建了文件夹/ux/tip/,并将文件toast.js(重命名为glc_tip.js)和tip.scss放入其中。
之后我修改了app.json,所以带有“js”和“css”的部分看起来像:
"js": [{
"path": "app.js",
"bundle": true
},{
"path": "/ux/tip/toast.js",
"bundle": true
}],
"css": [{
// This entry uses an ant variable that is the calculated value of the generated
// output css file for the app, defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
},{
"path": "/ux/tip/tip.scss"
}],
之后我做了sencha app refresh
和sencha app build development
,但还是不行。我收到一个错误:
未捕获的引用错误:未定义 GLC
在 constructor.handler
最好在'app.json'文件中注册第三方库。必须有 js 和 css 部分。你可以把它放在'/ux/tip/toast.js'文件中(如果不存在则创建目录)。
Js文件在
"js": [
{
"path": "${framework.dir}/build/ext-all-rtl-debug.js"
},
{
"path": "app.js",
"bundle": true
}
],
CSS 个文件将在
中注册
"css": [
{
// this entry uses an ant variable that is the calculated
// value of the generated output css file for the app,
// defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
}
],
并且不要忘记重建和刷新您的项目以应用更改。
我在 GitHub 上遇到了我想在我的应用程序中使用的 extjs class。 我应该把那个文件放在哪里?
我知道 extjs 中的文件结构遵循一些模式,所以例如如果我的应用程序的名称是 MyApp,那么我将 classes 放在相应的文件夹中,例如 MyApp.view.myfolder.MyClass
.
但是,在这种情况下,class 的用法为
GLC.tip.toast(title, message, options)
所以我怀疑我是否应该将它放在某个视图文件夹中。另一方面,我尝试将这两个文件(glc_tip.js 和 tip.scss)复制到我的应用程序的根文件夹中,并在 index.html 中包含以下行:
<script type="text/javascript" src="glc_tip.js"/>
但它也不起作用。我收到一个未定义的错误。
更新
我在应用程序根目录中创建了文件夹/ux/tip/,并将文件toast.js(重命名为glc_tip.js)和tip.scss放入其中。 之后我修改了app.json,所以带有“js”和“css”的部分看起来像:
"js": [{
"path": "app.js",
"bundle": true
},{
"path": "/ux/tip/toast.js",
"bundle": true
}],
"css": [{
// This entry uses an ant variable that is the calculated value of the generated
// output css file for the app, defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
},{
"path": "/ux/tip/tip.scss"
}],
之后我做了sencha app refresh
和sencha app build development
,但还是不行。我收到一个错误:
未捕获的引用错误:未定义 GLC 在 constructor.handler
最好在'app.json'文件中注册第三方库。必须有 js 和 css 部分。你可以把它放在'/ux/tip/toast.js'文件中(如果不存在则创建目录)。
Js文件在
"js": [
{
"path": "${framework.dir}/build/ext-all-rtl-debug.js"
},
{
"path": "app.js",
"bundle": true
}
],
CSS 个文件将在
中注册"css": [
{
// this entry uses an ant variable that is the calculated
// value of the generated output css file for the app,
// defined in .sencha/app/defaults.properties
"path": "${build.out.css.path}",
"bundle": true,
"exclude": ["fashion"]
}
],
并且不要忘记重建和刷新您的项目以应用更改。