scaleable-image
插件名#
scaleable-image安装#
- npm
- Yarn
npm install @jswork/styled-plugin-scaleable-imageyarn add @jswork/styled-plugin-scaleable-image参数#
| 名称 | 类型 | description |
|---|---|---|
| duration | string | 动画间隙,默认 0.3s |
| value | number | 鼠标移入,scale 的倍数,默认 1.05 |
原理#
- 鼠标移入,transorm 改变 scale 的值
- 如果有多个 transform,需要自己注意冲突问题
用法#
<View plugin="scaleable-image" sub="img" wh={200} auto debug> <View as="img" className="is-scaleable" src="https://tva1.sinaimg.cn/large/007S8ZIlgy1gexw87htqhj305k05k74o.jpg" /></View>演示#
Live Editor
Result
SyntaxError: Unexpected token (1:8)
1 : return ()
^