- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 click.tigger() 将模板的模式更改为可编辑。问题是我在这个模板中有一个图片库,我不希望 click.trigger 触发。
app.js:
<div click.trigger="enableEdit()">
<response containerless></response>
</div>
响应.html:
<template>
<div>
...
<gallery></gallery> <-- I want this to still be able to fire
<button click.trigger="save()">save</button> <-- I want this to work as well but they wont with "enableEdit()" above attached.
</div>
</template>
Gallery.js:
attached() {
const carousel = new Flickity(this.gallery, {
cellAlign: 'left',
contain: true,
lazyLoad: true,
});
}
一旦我单击触发器,它就会起作用并启用编辑。该画廊正在使用名为 Flickity 的插件。上面我展示了我如何实例化它。
最佳答案
考虑将单击绑定(bind)放在同级元素上。避免阻止事件冒泡,因为它会使您的代码变得脆弱/不可移植。
快速修复方法是检查点击事件的 target 。查明点击是否源自您的 gallery
元素或其子元素之一。
<div click.trigger="enableEdit($event.target)">
<response containerless></response>
</div>
enableEdit(target) {
if (target.nodeName === 'gallery' || target.closest('gallery') !== null) {
// it's the gallery element or one of it's children... get out of here...
return;
}
...
}
注意:Element.closest(selector)
不是supported尚未在 Internet Explorer 中使用。使用simple polyfill为了安全起见。
关于javascript - 阻止 click.trigger() 在特定嵌套元素上触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38514138/
我的应用程序中有大约 100 多个表。大多数更新查询不会更新最后更新的时间列。有 100 多个查询,所以我有点怀疑修改所有查询以包括上次更新时间。我正在寻找的替代选项是为所有表创建一个 oracle
我的应用程序中有大约 100 多个表。大多数更新查询不会更新最后更新的时间列。有 100 多个查询,所以我有点怀疑修改所有查询以包括上次更新时间。我正在寻找的替代选项是为所有表创建一个 oracle
trigger.io 是否支持黑莓?如果没有,是否有任何计划支持它。 最佳答案 在移动方面,他们目前支持: iOS 4+ (iPhone 和 iPad) 安卓 2.0+ window 电话* 我不知道
这是 here 中的一个改写的问题。经过一些测试后,我隔离了问题,但没有解决它的线索。无需阅读上一个问题,这是简化的代码: 问题 -> trigger('click')执行,但在循环(间隔)函数内时不
我有一个程序,它会从 redis 数据存储中轮询某个键,并在该值满足某个条件时执行某些操作。 不过我觉得redis周期性的轮询效率很低,想知道redis有没有“触发”机制,当值发生变化满足条件时,触发
现在我的合作者收到这样的错误:[错误] Forge API call to app/f7617c848[...]adcbe/should_rebuild 出错:应用匹配查询不存在。 最佳答案 我们正在
当用户在我的 trigger.io iOS 应用程序(使用 Parse.com)上收到推送通知并希望在用户打开应用程序时清除徽章时,我将徽章设置为 1。有谁知道如何做到这一点? 谢谢! 最佳答案 有几
iPhone 启动图像现在显示太短,我想延长持续时间。 有没有办法在 config.json 中指定它? 最佳答案 更新 :从平台版本 v1.4.20 开始,您可以控制启动图像的可见性(http://
如何将文件下载到我的 trigger.io 应用程序?我的应用程序显示离线数据,但我需要我的应用程序如何从服务器下载和存储本地新鲜数据的方式。数据是一个带有项目数组和一些图像的 js 文件,每个图像都
为了根据条件更改 ListBoxItem 前景,我可以通过 DataTemplate.Triggers 来完成: ...
为了根据条件更改 ListBoxItem 前景,我可以通过 DataTemplate.Triggers 来完成: ...
我们正在构建一个以 Chaplin 为基础的 Trigger 应用程序。出于开发目的,如果我们可以使用 Assets 的绝对路径,那就太好了,比如: 是否可以在 Trigger 中执行此操作?
什么时候应该选择Style.Triggers,什么时候应该选择ControlTemplate.Triggers?使用一个比另一个有什么好处吗? 假设我有实现相同结果的这些样式:
在我的情况下,我将有一个带有自定义 url 架构的重定向 URL,例如 myapp://oauth 所以首先我会转发到我的 oauth 登录 url,然后我需要为位置更改注册一个事件处理程序,以检查它
我可以创建一个带有 OR 条件的 MYSQL TRIGGER 创建或替换触发器 TIGGER 名称插入之前或更新或删除 像这样(下面是 ORACLE TRIGGER): CREATE OR REPLA
有两个相同类型但存在于不同类中的属性。 FrameworkElement.Triggers Property Style.Triggers Property 这让我很困惑,所以我很少有问题要寻找答案:
我有兴趣为 trigger.io 编写 native 插件。 这是否已经可能或在路线图上? 最佳答案 这绝对在路线图上:我们从一开始就不允许这样做的主要原因是我们最初的主要重点是创建一个尽可能平稳和快
我知道如何缓存它,但我以后如何检索它。文档 ( http://docs.trigger.io/en/v1.4/features/cache.html ) 仅给出了使用图像的示例,要检索您需要做的就是获
在 AzureFunction1 中收到简短通知后,我需要一种可靠的方法将其快速保存,然后触发另一个 Azurefunction 来分析数据并根据分析进行其他操作。 我正在寻找一种向 azure fu
我正在尝试使用 Trigger.io 的框架构建一个流式音频应用程序。 看到它的 API 目前没有任何与音频相关的方法,我用基本的 HTML5 audio 对其进行了测试。标签。在这种情况下流式传输
我是一名优秀的程序员,十分优秀!