File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 55基于EarthSDK、webpack和vue创建的极简App,可以调试和打包。
66其中Vue以独立的js文件从外部引入。
77
8+ ![ 预览] ( tools/images/preview.jpg )
9+
10+ 注意:小项目可以使用这种方式,比较省事,大型项目最好用Earth-webapck-vue-App或者Earth-vue-cli-App这两个项目来构建。
11+
12+ 这个项目的缺点是,vue组件的创建,不能直接写xxx.vue文件,需要用js方式书写,类似下面这种形式:
13+
14+ ```
15+ // 1 创建Earth的vue组件
16+ var EarthComp = {
17+ template: `
18+ <div style="width: 100%; height: 100%">
19+ <div ref="earthContainer" style="width: 100%; height: 100%">
20+ </div>
21+ <div style="position: absolute; left: 18px; top: 18px">
22+ <button>{{ message }}</button>
23+ </div>
24+ </div>
25+ `,
26+ data() {
27+ return {
28+ message: '页面加载于 ' + new Date().toLocaleString(),
29+ _earth: undefined, // 注意:Earth和Cesium的相关变量放在vue中,必须使用下划线作为前缀!
30+ _bgImagery: undefined,
31+ };
32+ },
33+ // ...
34+ }
35+
36+ export default EarthComp;
37+ ```
38+
839## 使用方法
940
10410 . 安装
You can’t perform that action at this time.
0 commit comments