mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
84 lines
2.2 KiB
HTML
84 lines
2.2 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="zh">
|
||
|
<head>
|
||
|
<meta charset="UTF-8" />
|
||
|
<title>MobileView</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta
|
||
|
name="viewport"
|
||
|
content="width=device-width, initial-scale=1, maximum-scale=1"
|
||
|
/>
|
||
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
|
||
|
<link rel="stylesheet" href="/amis/pkg/npm_181bd8c.css" />
|
||
|
<link rel="stylesheet" title="ang" href="/amis/n/amis/lib/themes/ang_f2a8c0c.css" />
|
||
|
<link
|
||
|
rel="stylesheet"
|
||
|
title="cxd"
|
||
|
disabled href="/amis/n/amis/lib/themes/cxd_e9076ac.css" />
|
||
|
<link
|
||
|
rel="stylesheet"
|
||
|
title="dark"
|
||
|
disabled href="/amis/n/amis/lib/themes/dark_26e78ed.css" />
|
||
|
<link
|
||
|
rel="stylesheet"
|
||
|
title="antd"
|
||
|
disabled href="/amis/n/amis/lib/themes/antd_9357176.css" />
|
||
|
<link rel="stylesheet" href="/amis/n/amis/lib/helper_e9038b1.css" />
|
||
|
<style>
|
||
|
.app-wrapper {
|
||
|
position: relative;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<div id="root" class="app-wrapper"></div>
|
||
|
<script src="/amis/pkg/npm_438ecb3.js"></script>
|
||
|
<script type="text/javascript" src="/amis/pkg/examples/mobile.html_map_d7f062f.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
const themes = [
|
||
|
{
|
||
|
label: '云舍',
|
||
|
value: 'cxd'
|
||
|
},
|
||
|
{
|
||
|
label: 'Ang',
|
||
|
value: 'ang'
|
||
|
},
|
||
|
{
|
||
|
label: 'Dark',
|
||
|
value: 'dark'
|
||
|
},
|
||
|
{
|
||
|
label: 'antd',
|
||
|
value: 'antd'
|
||
|
}
|
||
|
];
|
||
|
// mobile 下先禁掉所有外链避免影响
|
||
|
document.querySelectorAll('link[title]').forEach(item => {
|
||
|
item.disabled = true;
|
||
|
});
|
||
|
let theme = localStorage.getItem('amis-theme') || 'cxd';
|
||
|
if (theme == 'default') {
|
||
|
theme = 'cxd';
|
||
|
}
|
||
|
|
||
|
const linkDom = document.querySelector(`link[title=${theme}]`);
|
||
|
|
||
|
if (linkDom) {
|
||
|
linkDom.disabled = false;
|
||
|
}
|
||
|
|
||
|
if (theme === 'dark') {
|
||
|
document.querySelector('body').classList.add('dark');
|
||
|
}
|
||
|
|
||
|
amis.require(['5cd8f64'], function (app) {
|
||
|
app.bootstrap(document.getElementById('root'), {});
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|