5. 完整示例代码
second.html
<head>
<meta charset="utf-8">
<title>My Second MIP Page</title>
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
h2 {
text-align: center;
margin: 10px auto;
}
.main-image {
margin: 10px auto;
display: block;
}
p,h3 {
margin: 10px;
}
</style>
<body>
<mip-img src="https://www.mipengine.org/static/img/mip_logo_3b722d7.png" width="213" height="112" class="main-image"></mip-img>
<p>MIP 为所有组件提供了一些常用的样式,避免开发者在编写组件时重复实现。这部分样式会在以后的迭代中逐步完善,敬请开发者们关注。</p>
<h3>一像素边框</h3>
<p>针对移动端浏览器在高清屏幕显示中最常见的“一像素边框”问题,MIP 给出了通用的解决方案。开发者只需要引入固定的类名即可绘制出真实的一像素边框。</p>
<mip-shell>
<script type="application/json">
{
"routes": [
{
"pattern": "/use-shell.html",
"meta": {
"header": {
"show": true,
"title": "我的首页",
"logo": "https://gss0.bdstatic.com/5bd1bjqh_Q23odCf/static/wiseindex/img/favicon64.ico",
"buttonGroup": [
{
"name": "subscribe",
"text": "关注"
"name": "chat",
"text": "发消息"
}
]
},
"view": {
"isIndex": true
}
}
},
{
"pattern": "*",
"meta": {
"header": {
"show": true,
"title": "其他页面"
}
}
}
]
}
</script>
</mip-shell>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
</html>