youzanyun-devtool-worker
Version:
63 lines (61 loc) • 1.9 kB
HTML
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>h5组件预览</title>
<!-- <link rel="stylesheet" href="/utils/vant/index.css"> -->
<style>
body {
margin: 0;
}
</style>
</head>
<body>
<div id="app"></div>
<script src="/utils/vue.min.js"></script>
<!-- <script src="/utils/vant/vant.min.js"></script> -->
<script>
function _cdnFallback(){};
window.youzanyunbridge = {
getData: () => {},
pageData: '',
getProcess: {},
events: {},
};
</script>
<script src="" charset="utf-8" onerror="_cdnFallback(this)"></script>
<script src="https://file.yzcdn.cn/mall-cloud/"></script>
<script>
window.onload = function() {
var components = {};
var mallCloudComps = (window.mallCloud && window.mallCloud.components) || {};
Object.keys(mallCloudComps).forEach(item => {
var name = mallCloudComps[item].name;
components[name] = mallCloudComps[item];
});
var VueComp = null;
// console.log('window.mallCloud.Vue', window.mallCloud.Vue);
if (window.mallCloud && window.mallCloud.Vue) {
window.Vue = window.mallCloud.Vue;
}
if (!window._global) {
window._global = {design: []};
}
if (!window._global.design) {
window._global.design = [];
}
var VueComp = new window.Vue({
render: (createElement) => {
let children = window._global.design.map(item => {
return createElement(window.Vue.extend(components[item.type]));
});
return createElement('div', children);
}
});
VueComp.$mount('#app');
}
</script>
{% include "./common/track.html" %}
</body>
</html>