我正在使用基于jquery的eyeCon颜色选择器(http://www.eyecon.ro/colorpicker/).
当我单击并将鼠标拖到彩色区域上时,颜色会发生变化.但是当我点击彩色区域时,颜色不会更新.
我挖掘了它的源代码,发现了两个名为downSelector()和moveSelector()的函数分别在mousedown和mousemove上调用.我刚刚在downSelector()函数上添加了对moveSelector()的调用,传递了自己的ev对象.但它不起作用并抛出以下错误:未捕获的TypeError:无法读取未定义的属性'cal'
这可能是因为mousedown和mousemove的ev对象不同.
但我需要更新mousedown事件的颜色.有什么建议?
提前致谢 :)
我EventFeedbackComponent通过ModalController 显示一个Component .现在我想订阅一个Subjectin EventFeedbackComponent.如何访问组件实例,以实现我的目标.
我目前的代码:
let modal = this.modalCtrl.create(EventFeedbackComponent);
modal.present();
// This is not working. Throws the error "ERROR TypeError: Cannot read property 'subscribe' of undefined"
modal._component.feedbackSubmit.subscribe(feedbackResponse => {
console.log(feedbackResponse);
});
Run Code Online (Sandbox Code Playgroud)
文档在这方面没有帮助:https://ionicframework.com/docs/api/components/modal/ModalController/
我的用例:
Service,我需要获得反馈.EventFeedbackComponent 有控件来获取单个事件的反馈.feedbackSubmit通过来监听事件Subjectfeedback,我会显示一个成功Toast并在Service中切换我的服务变量以显示下一个事件.我正在使用PHPUnit跟踪Slim的测试设置@ http://there4development.com/blog/2013/10/13/unit-testing-slim-framework-applications-with-phpunit/
最初我在匿名函数中拥有所有逻辑
$app->get('/video/', function () use ($app) {
// all code goes here
}
Run Code Online (Sandbox Code Playgroud)
并通过PHPUnit进行测试工作得很好......
public function testVideoCountInPage1() {
$this->get('/video/');
$this->assertEquals(200, $this->response->status());
$rawResponse = $this->response->body();
$jsonResponse = json_decode($rawResponse);
$this->assertSame(20, count($jsonResponse->data));
}
Run Code Online (Sandbox Code Playgroud)
但现在,我将`get('/ video /')中的核心逻辑拆分成多个函数,如下所示:
$app->get('/video/', function () use ($app) {
// some logic
$db = openDB($dbConfig);
$page = findPageParameter($app->request()->params());
// some logic
}
function openDB($dbConfig) {
// open DB here
return $db;
}
function findPageParameter($params) {
// find page here
return (int)$page;
}
Run Code Online (Sandbox Code Playgroud)
我仍然得到适当的响应呼叫/video端点.但单位测试失败,说
.PHP Fatal error: …
我想让我的标题背景颜色透明。我的 HTML 如下:
帐户.page.html
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="home"></ion-back-button>
</ion-buttons>
<ion-title>Account</ion-title>
</ion-toolbar>
</ion-header>
Run Code Online (Sandbox Code Playgroud)
账户.page.scss
ion-header {
--ion-toolbar-background-color: rgba(0, 0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)
这使得 bg 颜色为白色,而不是透明。我还尝试background: transparent通过 Chrome Inspector 对每个元素进行设置。但我只是得到white.
任何帮助如何实现这一目标?