Skip to content

Commit c905117

Browse files
committed
update
1 parent d9415f4 commit c905117

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

example/src/index.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vcode{
2+
width: 300px;
3+
}

example/src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Vcode from "../../dist/index.js";
33
import ReactDom from "react-dom";
44
import ImgTest1 from "../assets/test1.png";
55
import ImgTest2 from "../assets/test2.png";
6+
import './index.css';
7+
68
class Test extends React.Component {
79
constructor(props) {
810
super(props);
@@ -11,7 +13,7 @@ class Test extends React.Component {
1113
input2: "", // 第2个input的值
1214
vcode2: "-1", // 第2个vcode的值
1315
code: "",
14-
width: 150,
16+
width: 100,
1517
};
1618
}
1719

@@ -64,7 +66,7 @@ class Test extends React.Component {
6466
<div>
6567
<div>
6668
<input type="text" placeholder="请输入正确的验证码" value={this.state.input2} onChange={e => this.onInput2Change(e)} maxLength={20} />
67-
<Vcode onChange={v => this.onVcode2Change(v)} onClick={() => console.log('触发onClick') } value={this.state.code} width={this.state.width} />
69+
<Vcode onChange={v => this.onVcode2Change(v)} onClick={() => console.log('触发onClick') } value={this.state.code} width={this.state.width} className={'vcode'}/>
6870
<span>{this.state.input2 === this.state.vcode2 ? "输入正确" : "输入错误"}</span>
6971
</div>
7072
<hr />

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"eslint-plugin-react": "^7.20.6",
5757
"eslint-plugin-react-hooks": "^4.1.0",
5858
"file-loader": "^6.1.0",
59+
"postcss-loader": "^4.0.2",
5960
"prettier": "^2.1.1",
6061
"source-map-loader": "^1.1.0",
6162
"style-loader": "^1.2.1",

webpack.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
{
1717
test: /\.css?$/,
1818
use: ["style-loader", "css-loader", "postcss-loader"],
19-
include: [path.join(__dirname, "src")],
19+
include: [path.join(__dirname, "example")],
2020
},
2121
{
2222
test: /\.(png|jpg|gif)$/,
@@ -26,7 +26,7 @@ module.exports = {
2626
{
2727
test: /\.(eot|woff|svg|ttf|woff2|appcache|mp3|pdf|png)(\?|$)/,
2828
use: ["file-loader?name=files/[name].[ext]"],
29-
include: [path.join(__dirname, "src")],
29+
include: [path.join(__dirname, "example")],
3030
},
3131
],
3232
},

0 commit comments

Comments
 (0)