收藏
回答

小程序为什么不支持svg 动画?

小程序为什么不支持svg 动画?

回答关注问题邀请回答
收藏

2 个回答

  • ElPsyCongroo
    ElPsyCongroo
    06-07

    支持的吧 , 比如 使用weui的 loading , 我这边手机和开发者工具都能动 。但是无法通过css让svg动起来 , 只能使用svg自身的动画

    .weui-loading {
    	display: inline-block;
    	vertical-align: middle;
    	font-size: 16px;
    	width: 1em;
    	height: 1em;
    	mask: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz48c3ZnIHdpZHRoPSc4MHB4JyBoZWlnaHQ9JzgwcHgnIHZpZXdCb3g9JzAgMCA4MCA4MCcgdmVyc2lvbj0nMS4xJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJz48dGl0bGU+bG9hZGluZzwvdGl0bGU+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSc5NC4wODY5MTQxJScgeTE9JzAlJyB4Mj0nOTQuMDg2OTE0MSUnIHkyPSc5MC41NTkwODIlJyBpZD0nbGluZWFyR3JhZGllbnQtMSc+PHN0b3Agc3RvcC1jb2xvcj0nIzYwNjA2MCcgc3RvcC1vcGFjaXR5PScwJyBvZmZzZXQ9JzAlJz48L3N0b3A+PHN0b3Agc3RvcC1jb2xvcj0nIzYwNjA2MCcgc3RvcC1vcGFjaXR5PScwLjMnIG9mZnNldD0nMTAwJSc+PC9zdG9wPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IHgxPScxMDAlJyB5MT0nOC42NzM3MDYwNSUnIHgyPScxMDAlJyB5Mj0nOTAuNjI4NjYyMSUnIGlkPSdsaW5lYXJHcmFkaWVudC0yJz48c3RvcCBzdG9wLWNvbG9yPScjNjA2MDYwJyBvZmZzZXQ9JzAlJz48L3N0b3A+PHN0b3Agc3RvcC1jb2xvcj0nIzYwN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	mask-size: cover;
    	background-color: currentColor;
    	color: #606060;
    }
    
    06-07
    有用
    回复
  • Api调用师
    Api调用师
    2023-10-31

    我也想问,svg是某些应用场景完美的存在,css和canvas都不好用的

    2023-10-31
    有用
    回复 1
    • 阿良
      阿良
      发表于移动端
      2023-10-31
      svg 动画写完 发现运行不了🌚 第一次写小程序 难受😣 又得改成css实现
      2023-10-31
      回复
登录 后发表内容