Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在elm(elm ui)中悬停时如何使文本删除线?_Elm_Elm Ui - Fatal编程技术网

在elm(elm ui)中悬停时如何使文本删除线?

在elm(elm ui)中悬停时如何使文本删除线?,elm,elm-ui,Elm,Elm Ui,基本上我想让文本在悬停时删除。这对我来说并不容易 el [ mouseOver [Font.strike] ] (text "some text") 就像对我一样 el [ mouseOver [Background.color someColor] ] (text "some other text") 因为Font.strike是属性msg而Background.color是Attr装饰msg 是否有人知道如何使用Font.strike之类的工具实现

基本上我想让文本在悬停时删除。这对我来说并不容易

el [ mouseOver [Font.strike] ] (text "some text")
就像对我一样

el [ mouseOver [Background.color someColor] ] (text "some other text")
因为
Font.strike
属性msg
Background.color
Attr装饰msg

是否有人知道如何使用
Font.strike
之类的工具实现所描述的行为


如果不可能,我也会接受非
elm ui
解决方案。

正如您已经指出的,
mouseOver
需要
Attr装饰msg
。它使用
CSS
进行悬停(因此受到限制),它负责在鼠标悬停时应用样式,并在鼠标悬停时清除样式

对于一般情况,我们必须使用
Element.Events
来检测鼠标在我们身上的移动。我们还需要在
模型中跟踪此状态。然后我们可以根据模型有条件地应用
Font.strike
属性

我们可以在
元素上侦听这些事件。el

Events.onMouseEnter Enter
  :: Events.onMouseLeave Leave
  :: style
,其中,
样式
[Font.strike]
[]
,具体取决于型号

此处的完整代码和工作演示:

可用于。