The problem of invalid style is introduced into the application of Dva construction.

Dva build
the first type:

...
import styles from "./index.css";
function Index(){
  return(
    <div className={style.index}><div>
  )
}
export default Index;

second type:

...
import "./index.css";
function Index(){
  return(
    <div className="index"><div>
  )
}
export default Index;

now the first one is effective and the second is invalid. Why is the second invalid?

< hr >

it is possible that css modules is enabled by Dva by default,
if you want < div className= "index" >

to take effect, the style file should look like this:

:global{
    .index{...}
}

if you take a look at your style, it should be antd that covers your style and you just weigh your own style.


roadhog turns on cssmodule


https://dvajs.com/knowledgema.

by default.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e998f9-464ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e998f9-464ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?