几天没有触摸我的应用程序,今天当我尝试构建它时,我收到以下错误:
Error thrown while running shell command: "cordova build ios"
Error: Command failed: /bin/sh -c cordova build ios
Error: Cannot read property 'nodeValue' of undefined
Run Code Online (Sandbox Code Playgroud)
如果我删除ios平台并再次添加它,它将起作用,但这不是最好的解决方案......我想了解这个问题.
您是否知道可能导致此错误的原因以及解决此问题的最佳解决方案是什么?
谢谢.
我刚刚为React-Native创建了一个组件,我将很快推送到npm作为一个包.虽然我面临一个问题.
该组件依赖于另一个名为的npm包react-native-image-resizer.这个包需要链接rnpm才能工作.
虽然,当我在一个全新的项目中安装我的组件时,依赖项将不会自动链接,并且本机库不会出现在项目中.当然,当我运行时rnpm link,它也不会将它添加到项目中.
所以我想知道安装和链接这个依赖项的最佳方法是什么?
MacBook-Pro:Example $ npm install react-native-image-crop
> react-native-image-crop@1.0.0 preinstall /Users/alexmngn/Work/react-native-image-crop/Example/node_modules/.staging/react-native-image-crop-95365d1b
> npm install --save react-native-image-resizer
react-native-image-crop@1.0.0 (git+ssh://git@github.com/alexmngn/react-native-image-crop.git#90e002c7d0f01c9d61277c30cad375560f09a94a) /Users/alexmngn/Work/react-native-image-crop/Example/node_modules/.staging/react-native-image-crop-95365d1b
??? UNMET DEPENDENCY react-native@^0.31.0
??? react-native-image-resizer@0.0.9
npm WARN react-native-image-resizer@0.0.9 requires a peer of react-native@>=v0.14.2 but none was installed.
npm WARN react-native-image-crop@1.0.0 No repository field.
- react-native-image-resizer@0.0.9 node_modules/react-native-image-crop/node_modules/react-native-image-resizer
Example@0.0.1 /Users/alexmngn/Work/react-native-image-crop/Example
??? react-native-image-crop@1.0.0 (git+ssh://git@github.com/alexmngn/react-native-image-crop.git#90e002c7d0f01c9d61277c30cad375560f09a94a)
MacBook-Pro:Example $ rnpm link
MacBook-Pro:Example $ # Nothing gets linked here...
Run Code Online (Sandbox Code Playgroud)
另外,正如你在那里看到的那样,当我在我的示例项目中安装我的组件时,我有一个未满足的peer-dependencies问题,即使它在package.json中的依赖项中正确列出(使用正确的版本):
{
"name": "Example",
"version": "0.0.1",
"private": true,
"scripts": …Run Code Online (Sandbox Code Playgroud) 我正在尝试配置我的 TSLint 规则ordered-imports以使导入顺序如下所示:
// React
import React from 'react';
import { View } from 'react-native';
// Libs
import * as _ from 'lodash';
import * as moment from 'moment';
// Internal libs
import Bar from '@app/bar';
import Foo from '@app/foo';
// Relative paths
import { Element } from './my-element';
import MyFunction from './my-function';
Run Code Online (Sandbox Code Playgroud)
这是我试图创建的规则,但我仍然无法达到上述工作的程度。
我似乎无法匹配绝对导入以外react的绝对导入,我尝试使用null以及非反应匹配,^!react但它不起作用。
这是我的规则
{
"ordered-imports": [
true,
{
"module-source-path": "full",
"grouped-imports": true,
"groups": [
{
"name": "react",
"match": "^react", …Run Code Online (Sandbox Code Playgroud) 我知道这个主题已经围绕stackoverflow和其他论坛进行了讨论,但我找不到正确的方法来做到这一点.
我有一个名为"post"的模型,其中包含帖子信息(用户,描述等).用户收到一些帖子,读取它们并对它们进行操作.当我申请GET时,帖子来自我的api/api/posts/
我还有一个名为"后置状态"的模型,我保存阅读帖子的人的动作:当他们喜欢,分享,投票或喜欢帖子时.
export default DS.Model.extend({
post: belongsTo('post'),
user: belongsTo('user'),
liked: attr('boolean', { defaultValue: false }),
favourited: attr('boolean', { defaultValue: false }),
voted: attr('boolean', { defaultValue: false }),
shared: attr('boolean', { defaultValue: false }),
});
Run Code Online (Sandbox Code Playgroud)
我正在寻找一种方法让我的ember应用程序大量保存我的后状态模型,就像我批量收到帖子的方式一样.邮政状态将通过api调用POST保存/api/post-states/
我在讨论中读到最好的方法是创建一个自定义适配器,但我不知道该怎么做才能做到这一点...也许创建一个函数saveAllRecords()?
对我来说最好的解决方案是什么?
谢谢你的帮助!
我正在尝试为我的应用程序创建一个名称空间作为模块,并使用此命名空间导入我的组件并限制使用相对路径.
虽然,虽然我在这里遵循webpack文档的别名:http://webpack.github.io/docs/configuration.html#resolve-alias 我无法使它工作.
这是我的解析对象的样子:
resolve: {
root: path.resolve(__dirname),
alias: {
myApp: './src',
},
extensions: ['', '.js', '.json', '.jsx']
}
Run Code Online (Sandbox Code Playgroud)
path.resolve(__dirname) 做出决议 /Users/Alex/Workspace/MyAppName/ui/
我在文件中导入我的文件/Users/Alex/Workspace/MyAppName/ui/src/components/Header/index.jsx:
import { myMethod } from 'myApp/utils/myUtils';
Run Code Online (Sandbox Code Playgroud)
我在构建期间收到以下错误:
ERROR in ./src/components/Header/index.jsx
Module not found: Error: Cannot resolve module 'myApp/utils/myUtils' in /Users/Alex/Workspace/MyAppName/ui/src/components/Header
@ ./src/components/Header/index.jsx 33:19-56
Run Code Online (Sandbox Code Playgroud)
我也尝试过modulesDirectories但它也不起作用.
你知道什么是错的吗?
我想在Ember核心表单组件中使用ARIA属性,例如输入和textarea字段.
我注意到在我的模板中使用组件中的aria属性,它根本不起作用
{{input aria-label="Your name"}}
{{textarea aria-label="Your address"}}
Run Code Online (Sandbox Code Playgroud)
所以我决定在初始化程序中重新打开核心组件,将此属性添加到组件中
export default {
name: 'reopenTextAreaComponent',
initialize: function () {
Ember.TextArea.reopen({
attributeBindings: ['aria-label']
});
}
};
Run Code Online (Sandbox Code Playgroud)
自从我这样做以来,我的应用程序的性能非常糟糕.集成测试比以前花费更多时间.
我尽量不使用他们的组件,只是一个HTML标签:
<textarea {{bind-attr aria-label="Your address"}}>{{value}}</textarea>
Run Code Online (Sandbox Code Playgroud)
但这不能用把手编译!由于{{value}}textarea标记内部,它返回错误.
避免重新开放的解决方案是什么?我应该创建自己的组件吗?
谢谢
我有一个基于React-Native平台具有2个不同设计的组件:MyComponent.ios.tsx和MyComponent.android.tsx。
虽然将组件导入MyView.tsx时会抱怨。
MyView.tsx(5,38):错误TS2307:找不到模块“ ./MyComponent”。
我试图将tsconfig文件路径修改为以下内容:
"paths": {
"*": ["*", "*.ios", "*.android"]
},
Run Code Online (Sandbox Code Playgroud)
虽然我仍然有同样的问题。
你们当中有人知道如何解决此问题吗?
谢谢
我想知道是否有办法在创建商店后注入 Redux 商店中间件?
我想要一些类似的东西:
injectMiddleware(store, [middleware1, middleware2]);
Run Code Online (Sandbox Code Playgroud)
以类似的方式,我们可以在创建商店后使用replaceReducer https://redux.js.org/api-reference/store#replaceReducer 动态替换 root reducer 。
我在PopoverController中的UITableView有问题.当我触摸单元格时,调用didSelectRowAtIndexPath函数,并更改单元格accessoryType.简化示例:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.listItems objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryCheckmark;
[self.tableView reloadData];
[self.popoverController dismissPopoverAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)
它正在工作,单元格被检查,但在我的tableview上看不到:我看不到蓝色的复选标记.但是,在单元格上的触摸状态下,复选标记以白色显示(并且单元格背景为灰色).但在默认状态下不可见.
你知道为什么我的复选标记在默认状态下不可见吗?
谢谢,
编辑:为一个单元格添加屏幕截图 accessoryType = UITableViewCellAccessoryCheckmark

我想知道是否可以使用BackboneJS从子视图调用视图函数.如果是的话,它是如何工作的?
我想从子视图中调用属于mainView的函数"hello".
也许如果事件触发......
例:
var MainView = Backbone.View.extend({
initialize: function() {
this.$template = $(template);
this.subview = new SubView();
this.render();
},
render: function() {
this.$el.html(this.$template);
var element = this.$template.attr('id');
this.subview.setElement('#'+element).render();
},
hello: function() {
alert('Hello');
}
});
var SubView = Backbone.View.extend({
initialize: function() {
this.$template = $(template);
this.render();
},
render: function() {
this.$el.html(this.$template);
//Call view function ' hello '
//parentView.hello();
}
});
Run Code Online (Sandbox Code Playgroud)
谢谢!
javascript ×8
ios ×3
ember.js ×2
node.js ×2
react-native ×2
typescript ×2
android ×1
backbone.js ×1
cordova ×1
ecmascript-6 ×1
ember-data ×1
npm ×1
npm-install ×1
objective-c ×1
performance ×1
reactjs ×1
redux ×1
redux-store ×1
tslint ×1
uitableview ×1
wai-aria ×1
webpack ×1