美文网首页
Nextjs styled-jsx animation

Nextjs styled-jsx animation

作者: aibinMr | 来源:发表于2019-05-09 04:46 被阅读0次

Nextjs自带的styled-jsx(v 3.2.1)可能是不支持css3动画中@keyframes,多次尝试失败,现在采用把@keyframes写入css文件中,通过页面入口引入,(注意,在组件内部使用Head组件会编译出错)

import React from 'react'

import Head from 'next/head'

class Index extends React.Component {

render() {

    return (

      <div>

        <Head>

        <link href="/static/css/animation/marquee.css"rel="stylesheet"/>

        </Head>

      </div>

    )

  }

}

export default Index

本人菜鸟,可能很多大佬有其他的解决方法,希望可以赐教下

相关文章

网友评论

      本文标题:Nextjs styled-jsx animation

      本文链接:https://www.haomeiwen.com/subject/fkfioqtx.html