Skip to content

Commit

Permalink
docs: demo
Browse files Browse the repository at this point in the history
  • Loading branch information
leonwgc committed Apr 19, 2024
1 parent 094152f commit 49ec88f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
11 changes: 6 additions & 5 deletions demo/App1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ export default function App() {
const [visible, setVisible] = useState(true);

const ref = useRef(0);
const ref1 = useRef(0);
const elRef = useRef();
const btnRef = useRef();

const forceRender = useForceUpdate();

useEffect(() => {
const p = placements[ref.current++] as any;
const p = placements[ref.current] as any;
Popover.show({
anchor: elRef,
style: { background: '#666', color: '#fff' },
Expand All @@ -48,7 +49,7 @@ export default function App() {
}, []);

const handlePkg = () => {
const p = placements[ref.current++] as any;
const p = placements[ref1.current++] as any;

Popover.show({
anchor: elRef,
Expand All @@ -57,8 +58,8 @@ export default function App() {
placement: p,
});

if (ref.current > 11) {
ref.current = 0;
if (ref1.current > 11) {
ref1.current = 0;
}
};

Expand Down Expand Up @@ -109,7 +110,7 @@ export default function App() {
<AutoCenter style={{ marginTop: 100 }}>
<img src={pkq} ref={elRef} onClick={handlePkg} style={{ cursor: 'pointer' }} />
</AutoCenter>
<div style={{ height: '100vh' }}></div>
{/* <div style={{ height: '100vh' }}></div> */}
</DemoBlock>
</PageWrap>
);
Expand Down
28 changes: 14 additions & 14 deletions docs/index.79e642.js → docs/index.a48c5f.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,27 +834,28 @@
n = e[0],
o = e[1],
c = (0, r.useRef)(0),
l = (0, r.useRef)(),
l = (0, r.useRef)(0),
p = (0, r.useRef)(),
d = (0, u.Z)();
d = (0, r.useRef)(),
m = (0, u.Z)();
(0, r.useEffect)(function () {
var t = gt[c.current++];
var t = gt[c.current];
rt.show({
anchor: l,
anchor: p,
style: { background: '#666', color: '#fff' },
content: r.createElement(vt, null, t),
placement: t,
});
}, []);
var m = function () {
var t = gt[c.current++];
var h = function () {
var t = gt[l.current++];
rt.show({
anchor: l,
anchor: p,
style: { background: '#666', color: '#fff' },
content: r.createElement(vt, null, t),
placement: t,
}),
c.current > 11 && (c.current = 0);
l.current > 11 && (l.current = 0);
};
return r.createElement(
dt,
Expand All @@ -881,7 +882,7 @@
{
type: 'primary',
onClick: function () {
o(!0), c.current++, c.current > 11 && (c.current = 0), d();
o(!0), c.current++, c.current > 11 && (c.current = 0), m();
},
},
'点我试试'
Expand All @@ -895,11 +896,11 @@
r.createElement(
s.Z,
null,
r.createElement(f.Z, { type: 'primary', onClick: m }, '静态调用'),
r.createElement(f.Z, { type: 'primary', onClick: h }, '静态调用'),
r.createElement(
f.Z,
{
ref: p,
ref: d,
onClick: function () {
rt.hide();
},
Expand All @@ -910,9 +911,8 @@
r.createElement(
a.Z,
{ style: { marginTop: 100 } },
r.createElement('img', { src: ht, ref: l, onClick: m, style: { cursor: 'pointer' } })
),
r.createElement('div', { style: { height: '100vh' } })
r.createElement('img', { src: ht, ref: p, onClick: h, style: { cursor: 'pointer' } })
)
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="zh-cn"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover"/><meta name="format-detection" content="telephone=no, email=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-touch-fullscreen" content="yes"/><title></title><script defer="defer" src="runtime.a08797.js"></script><script defer="defer" src="vendor.a91d10.js"></script><script defer="defer" src="index.79e642.js"></script></head><body style="font-size:14px"><div id="root"></div></body></html>
<!doctype html><html lang="zh-cn"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,minimal-ui,viewport-fit=cover"/><meta name="format-detection" content="telephone=no, email=no"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-touch-fullscreen" content="yes"/><title></title><script defer="defer" src="runtime.a08797.js"></script><script defer="defer" src="vendor.a91d10.js"></script><script defer="defer" src="index.a48c5f.js"></script></head><body style="font-size:14px"><div id="root"></div></body></html>

0 comments on commit 49ec88f

Please sign in to comment.